1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-11 09:04:01 +03:00

bin/build: begins refactor.

This commit is contained in:
Samuel Dionne-Riel 2018-06-23 16:06:53 -04:00
parent 8bf617c77a
commit 3d517c0687

View File

@ -3,6 +3,12 @@
require "shellwords"
def run(*cmd)
puts " $ #{cmd.shelljoin}"
system(*cmd)
exit $?.exitstatus unless $?.exitstatus == 0
end
# Given a device name, instantiates `nix-build` to build
# everything needed to boot on that device.
@ -15,15 +21,10 @@ end
DEVICE = ARGV.shift
cmd = [
run(
"nix-build", "-A", "all",
"--argstr", "device", DEVICE,
*ARGV
]
)
puts " $ #{cmd.shelljoin}"
system(*cmd)
exit $?.exitstatus
# vim: ft=ruby