From 079d957abec864fae930bc0ca674f3fe0eb81405 Mon Sep 17 00:00:00 2001 From: Andrew Calder Date: Tue, 27 May 2025 21:28:15 +0100 Subject: [PATCH] fix SC2319 This $? refers to a condition, not a command. Assign to a variable to avoid it being overwritten. --- binscripts/gvm-installer | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/binscripts/gvm-installer b/binscripts/gvm-installer index 829a69a..9914894 100755 --- a/binscripts/gvm-installer +++ b/binscripts/gvm-installer @@ -124,7 +124,8 @@ if [ -z "$GVM_NO_UPDATE_PROFILE" ] ; then fi fi -if [ -z "$GVM_NO_UPDATE_PROFILE" ] && [ "$?" != "0" ]; then +# check $? first, otherwise may ref the test condition +if [ "$?" != "0" ] && [ -z "$GVM_NO_UPDATE_PROFILE" ]; then echo "Unable to locate profile settings file(Something like $HOME/.bashrc or $HOME/.bash_profile)" echo echo " You will have to manually add the following line:"