Skip to content

Instantly share code, notes, and snippets.

@GraemeF
Created November 21, 2011 07:24
Show Gist options
  • Save GraemeF/1381916 to your computer and use it in GitHub Desktop.
Save GraemeF/1381916 to your computer and use it in GitHub Desktop.
PowerShell script to keep running builds when stuff changes
Import-Module pswatch
Function Rebuild($message)
{
cls
Write-Host $message
Invoke-psake .\build.ps1
}
Rebuild "Starting up."
watch | Where-Object { ($_.Path -notlike "*.git*") -and ($_.Path -notlike "*.idea*") } | %{ Write-Output $_.Path.Replace("___jb_bak___", "") } | Where-Object { $_.EndsWith(".coffee") } | %{
cls
Write-Host "$_ changed."
Invoke-psake .\build.ps1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment