aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2018-05-18 10:51:29 -0400
committerLudovic Courtès <ludo@gnu.org>2018-05-19 22:47:07 +0200
commit593fe736674fadedd961c499e5758fa9c96a57aa (patch)
treed96befdb44ed7e91c4fabee2bd5b15f63c9e83ba /etc
parent428adbc2c498252b1120da27944edc6558c04d06 (diff)
downloadguix-593fe736674fadedd961c499e5758fa9c96a57aa.tar
guix-593fe736674fadedd961c499e5758fa9c96a57aa.tar.gz
guix-install.sh: Fix chk_require exiting without warning.
* etc/guix-install.sh (chk_require): Because of the set -e option, Bash was exiting when the command `command -v "$c" &>/dev/null' was running on its own. Instead, we now test the command and accumulate warning messages in a single statement by chaining the command with a logical OR. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'etc')
-rwxr-xr-xetc/guix-install.sh4
1 files changed, 1 insertions, 3 deletions
diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index 78cd7580bb..d9f1955098 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -86,9 +86,7 @@ chk_require()
_debug "--- [ $FUNCNAME ] ---"
for c in ${cmds[@]}; do
- command -v "$c" &>/dev/null
- [ "$?" -eq "1" ] &&
- warn+=("$c")
+ command -v "$c" &>/dev/null || warn+=("$c")
done
[ "${#warn}" -ne 0 ] &&