lib/simple/cli/helpers.rb in simple-cli-0.2.6 vs lib/simple/cli/helpers.rb in simple-cli-0.2.7
- old
+ new
@@ -27,21 +27,10 @@
def ssh!(target, command, user: nil)
sys! "#{ssh_command(target, user: user)} #{command}"
end
- def sh(cmd, *args)
- command = Command.new(cmd, *args)
- result = command.sh
- first_line, more = result.split("\n", 2)
- if more == ""
- first_line
- else
- result
- end
- end
-
def sh!(cmd, *args)
command = Command.new(cmd, *args)
result = command.sh
command.check_success!
first_line, more = result.split("\n", 2)
@@ -72,10 +61,9 @@
end
def sh
::Simple::CLI.logger.info "> #{self}"
stdout_str, @process_status = Open3.capture2(*@args, binmode: true)
- $? = @process_status
stdout_str
end
def run
::Simple::CLI.logger.info "> #{self}"