more breakout for feature
This commit is contained in:
23
lib/shared/runnable.rb
Normal file
23
lib/shared/runnable.rb
Normal file
@@ -0,0 +1,23 @@
|
||||
module Shared
|
||||
|
||||
module Runnable
|
||||
def run_cmd ( cmd, fallback_branch = current_branch )
|
||||
puts
|
||||
puts cmd
|
||||
success = system cmd
|
||||
unless success
|
||||
system "git checkout #{fallback_branch}"
|
||||
error "(see above)"
|
||||
end
|
||||
puts
|
||||
end
|
||||
|
||||
def error ( msg )
|
||||
puts
|
||||
puts "ERROR: #{msg}"
|
||||
puts
|
||||
exit
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user