require_relative "out" module Bash def _bash(cmd) cmd = handle_path(cmd) result = `#{cmd}` Out.out result end def handle_path(cmd) r = cmd[/\/(\w|\/)*/] if r cmd.gsub! r, "\'#{r}\'" else cmd end end def bash(*cmds) unless cmds.empty? _bash(cmds.flatten.join(" && ")) end end def bash_per(*cmds) cmds.each do |c| bash c end end def bash_lines(cmd) bash(cmd).split("\n") end end