Comments (5)
I am not familiar with gulp
and its watch
command. I will google but it would be useful if you describe some specs it terms of Invoke-Build
.
from invoke-build.
A naive approach from the top of my head. A working example of FileSystemWatcher
in PowerShell
is here. We configure it for required files and events and start it in a console which is kept running.
From the appropriate event handler we call Invoke-Build
with specified tasks and parameters, as usual.
from invoke-build.
Just to be clear, the above does not need anything extra in Invoke-Build
. It
is just a PowerShell script which uses Invoke-Build
as it is.
It is too simple and needs some work, depending on scenarios. For example, one
may want to wait for multiple changes to complete before triggering a build.
Or maybe it is fine that it is called for each event but the file system may
send multiple events for the same file (from the remarks from the link).
So a properly designed script is needed. But it is still not directly related
to Invoked-Build
. If you are thinking of some sort of integration then some
specs are definitely needed. I do not have any practical use cases on my own.
from invoke-build.
The script uses the Action
parameter. Yet another approach is possible and
may be simpler because processing is done not by PowerShell jobs. We just
subscribe to events without actions
Register-ObjectEvent $fsw Created -SourceIdentifier FileCreated
Register-ObjectEvent $fsw Deleted -SourceIdentifier FileDeleted
Register-ObjectEvent $fsw Changed -SourceIdentifier FileChanged
Then in the main script we use Wait-Event
or check for events periodically by
Get-Event
, process them and remove by Remove-Event
. Then repeat
waiting for events.
from invoke-build.
I created the tool Watch-Directory.ps1. It is designed for any command processing changes specified as a parameter, normally a script block. In your case this command may call Invoke-Build. The tool is not final and not fully tested but it seems to be working.
from invoke-build.
Related Issues (20)
- Amend output on task errors.
- Reusing or sharing tasks HOT 5
- ib.cmd ? ignores a specified file
- vscode outline view: no symbols found in document HOT 2
- Different module and package versions HOT 2
- Parallel execution based on dependency tree HOT 2
- invoke-build discovery fails in powershell container HOT 3
- Please consider adding -Computername and -Session parameter to Task HOT 8
- GitHub action output is not colored
- Color and formatting text in Azure DevOps Pipelines HOT 8
- Use-BuildEnv should make parameters mandatory
- Invoke-BuildExec spitting out service principal secret as current directory HOT 6
- Exec doesn't work well with forward slash arguments HOT 7
- Use `[System.Management.Automation.Cmdlet]::CommonParameters` to get the names of all common parameters HOT 3
- Task condition does not work HOT 8
- Build-Parallel writes only to Output stream HOT 7
- property 'File' cannot be found on this object HOT 17
- Do not wrap internal errors in Resolve-MSBuild
- Fix cryptic errors on unknown parameters
- Invoke-BuildExec should pass the original stderr error to the thrown terminating error HOT 38
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from invoke-build.