1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-11 09:04:01 +03:00
mobile-nixos/lib/rb/run.rb
2018-06-23 16:12:39 -04:00

13 lines
188 B
Ruby

require "shellwords"
def run(*cmd, exec: false)
puts " $ #{cmd.shelljoin}"
if exec then
Kernel.exec(*cmd)
else
system(*cmd)
end
exit $?.exitstatus unless $?.exitstatus == 0
end