Skip to content

Instantly share code, notes, and snippets.

@da9l
Forked from jfromaniello/continous-qunit.ps1
Last active December 24, 2015 06:58
Show Gist options
  • Save da9l/6760214 to your computer and use it in GitHub Desktop.
Save da9l/6760214 to your computer and use it in GitHub Desktop.
# watch a file changes in the current directory,
# execute all tests when a file is changed or renamed
$watcher = New-Object System.IO.FileSystemWatcher
$watcher.Path = get-location
$watcher.IncludeSubdirectories = $true
$watcher.EnableRaisingEvents = $false
$watcher.NotifyFilter = [System.IO.NotifyFilters]::LastWrite -bor [System.IO.NotifyFilters]::FileName
while($TRUE){
$result = $watcher.WaitForChanged([System.IO.WatcherChangeTypes]::Changed -bor [System.IO.WatcherChangeTypes]::Renamed -bOr [System.IO.WatcherChangeTypes]::Created, 1000);
if($result.TimedOut){
continue;
}
write-host "Change in " + $result.Name
#Run the psake bootstrapper.
.\build.ps1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment