Skip to content

Instantly share code, notes, and snippets.

@e2
Last active August 29, 2015 14:13
Show Gist options
  • Save e2/b39b406d0f3309261558 to your computer and use it in GitHub Desktop.
Save e2/b39b406d0f3309261558 to your computer and use it in GitHub Desktop.
Save this as bin/guard inside your projects
#!/usr/bin/env ruby
require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= (Pathname(__FILE__).realpath + '../../Gemfile').to_s
require 'rubygems'
require 'bundler/setup'
while !system(Gem.bin_path('guard', 'guard')) && $?.exitstatus == 2
puts('Restarting guard...')
end
exit($?.exitstatus)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment