From a6b32e34206dea3de4d24eaf4e9fcd5f59647ae1 Mon Sep 17 00:00:00 2001 From: Luka Vandervelden Date: Mon, 2 Sep 2019 16:40:33 +0200 Subject: [PATCH] `apk add` inherits stdin when called. --- src/main.cr | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.cr b/src/main.cr index 0510ba4..3fd2432 100644 --- a/src/main.cr +++ b/src/main.cr @@ -127,7 +127,12 @@ begin if dependencies.size > 0 # FIXME: We’ll probably want to have backends other than apk at some point. - r = context.sh "apk add #{ENV["APK_FLAGS"]? || "-i"} #{dependencies.join " "}" + opts = ["add"] + (ENV["APK_FLAGS"]? || "-i").split(/[ \t]+/) + dependencies + puts "+ apk #{opts.join " "}" + r = Process.run "apk", opts, + output: Process::Redirect::Inherit, + input: Process::Redirect::Inherit, + error: Process::Redirect::Inherit if r.exit_status != 0 STDERR.puts "!! Running apk failed!" exit 8