Created
March 5, 2010 10:35
-
-
Save apeiros/322628 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unless ENV["BUNDLE_GEMFILE"] then | |
if $stdout.tty? # Only do an interactive "do you really want to" if we're in an interactive session | |
require 'timeout' | |
Timeout.timeout 30 do | |
puts "\e[1;41m WARNING \e[0;41mYou're running `#{$0}` instead of `bundle exec #{$0}` \e[0m" | |
print "Proceed? [yN] " | |
$stdout.flush | |
abort "Terminated" unless $stdin.gets.chomp =~ /\Ay(?:es)?\z/i | |
end | |
else # not interactive, just terminate with a non-zero status | |
puts "You're running `#{$0}` instead of `bundle exec #{$0}`" | |
exit! 1 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment