Skip to content

Instantly share code, notes, and snippets.

@ruslander
Created December 4, 2012 04:06
Show Gist options
  • Save ruslander/4200482 to your computer and use it in GitHub Desktop.
Save ruslander/4200482 to your computer and use it in GitHub Desktop.
Erlang Rebar continuous test runner
$app = "C:\Users\rrusu\Documents\GitHub\Er101"
$watcher = New-Object System.IO.FileSystemWatcher
$watcher.Path = "$app\src\"
$watcher.IncludeSubdirectories = $true
$watcher.EnableRaisingEvents = $false
$watcher.NotifyFilter = [System.IO.NotifyFilters]::LastWrite -bor [System.IO.NotifyFilters]::FileName
set-location $app
while($TRUE){
$result = $watcher.WaitForChanged([System.IO.WatcherChangeTypes]::Changed -bor [System.IO.WatcherChangeTypes]::Renamed -bOr [System.IO.WatcherChangeTypes]::Created, 300);
if($result.TimedOut){
continue;
}
write-host "Change in " + $result.Name
rebar compile eunit
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment