Skip to content

Instantly share code, notes, and snippets.

@moredip
Created August 19, 2012 17:06
Show Gist options
  • Save moredip/3396305 to your computer and use it in GitHub Desktop.
Save moredip/3396305 to your computer and use it in GitHub Desktop.
A very hacky build script using Guard
require 'fileutils'
def run_guard
Signal.trap("HUP") { exit }
require 'guard'
Guard.setup
Guard::Dsl.evaluate_guardfile(:guardfile => 'Guardfile')
Guard.start
end
guard_pid = fork { run_guard }
sleep 2
Dir['source/**/*'].each{ |f| FileUtils.touch(f) }
sleep 2
Process.kill "HUP", guard_pid
Process.wait( guard_pid )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment