From 01fef6d81f8823895e0dad5615937ac00eb3d6e8 Mon Sep 17 00:00:00 2001 From: mpsijm Date: Tue, 20 Nov 2018 10:33:48 +0100 Subject: [PATCH 1/2] Remove `-s` option from `which` in test script When I tried running the tests with a debugger, the script failed with the following message: Illegal option -s Usage: /usr/bin/which [-a] args Illegal option -s Usage: /usr/bin/which [-a] args No debugger found In case this `-s` flag is needed for other OSes than Linux (I'm working with Ubuntu 18.04), this could be based on a `uname` check (like on line 44). --- script/test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/test b/script/test index 74025499..4c3cb075 100755 --- a/script/test +++ b/script/test @@ -112,9 +112,9 @@ case ${mode} in ;; debug) - if which -s lldb; then + if which lldb; then lldb $cmd -- "${args[@]}" - elif which -s gdb; then + elif which gdb; then gdb $cmd -- "${args[@]}" else echo "No debugger found" From e0bcb27943dd0e4091174971cb3f13b71dd0bca7 Mon Sep 17 00:00:00 2001 From: mpsijm Date: Tue, 20 Nov 2018 22:52:44 +0100 Subject: [PATCH 2/2] Pipe output of which (hash) to /dev/null --- script/test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/test b/script/test index 4c3cb075..eb394962 100755 --- a/script/test +++ b/script/test @@ -112,9 +112,9 @@ case ${mode} in ;; debug) - if which lldb; then + if hash lldb &> /dev/null; then lldb $cmd -- "${args[@]}" - elif which gdb; then + elif hash gdb &> /dev/null; then gdb $cmd -- "${args[@]}" else echo "No debugger found"