Permalink
Browse files

Util.shell, fixes #5

  • Loading branch information...
1 parent 3d9ee47 commit 0c8b4859a6db5a754a0bf76816b8f2553fc86fe5 @gurgeous gurgeous committed Oct 31, 2011
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/teleport/util.rb
View
@@ -89,6 +89,11 @@ def run_quietly(command, *args)
run("#{command} > /dev/null 2> /dev/null")
end
+ # Run one or several commands, separate by newlines.
+ def shell(commands)
+ commands.split("\n").each { |i| run(i) }
+ end
+
# Run a command, return true if it succeeds.
def succeeds?(command)
system("#{command} > /dev/null 2> /dev/null")

0 comments on commit 0c8b485

Please sign in to comment.