From de37cf341805cfa7efaba295da67d73776cc8637 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sun, 21 Jan 2018 12:48:15 +0100 Subject: [PATCH] build system: output error if command to execute isn't found --- NEWS.md | 2 ++ rake.d/helpers.rb | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 851cd0492..d846e238b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -16,6 +16,8 @@ bytes, not the encoded (compressed) number of bytes. Fixes #2200. * mkvinfo: Windows: line endings will be written as `\r\n` (carriage return & line feed) again instead of just `\n` (line feed). +* build system: an error message is output if a command to execute is not + found instead of silently failing. # Version 20.0.0 "I Am The Sun" 2018-01-15 diff --git a/rake.d/helpers.rb b/rake.d/helpers.rb index 28ddf3abd..acf8284d6 100644 --- a/rake.d/helpers.rb +++ b/rake.d/helpers.rb @@ -94,7 +94,15 @@ def runq(action, target, cmdline, options = {}) puts_action action, :target => target, :prefix => sprintf("[%s %02d:%02d.%03d]", code == 0 ? "done" : "fail", (duration / 60).to_i, duration.to_i % 60, (duration * 1000).to_i % 1000) end - exit code if (code != 0) && !options[:allow_failure].to_bool + if (code != 0) && !options[:allow_failure].to_bool + if code == 127 + puts "Error: command not found: #{cmdline}" + elsif code == -1 + puts "Error: could not create child process for: #{cmdline}" + end + + exit code + end end def runq_git(msg, cmdline, options = {})