From cf0a08baafebb03a4d60bc3b37167705eccd9c6d Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Thu, 3 Dec 2020 18:33:45 +0100 Subject: [PATCH] [bash] fix shellcheck error SC1073 The way I was doing the test is incorrect, as [ is the test(1) program and the shell builtin command is not something it understands. Instead, I now just let the shell execute `command` and then set the variable if `brew` is available. --- roles/bash/files/profile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/bash/files/profile b/roles/bash/files/profile index b0bccb6..974c946 100644 --- a/roles/bash/files/profile +++ b/roles/bash/files/profile @@ -21,7 +21,7 @@ export LESS="-i -j.49 -M -R -z-2" export LESSHISTFILE="$XDG_CACHE_HOME/less/history" export LESSHISTSIZE=1000 export LOCAL_PREFIX="/usr/local" -[ command -v brew &>/dev/null ] && LOCAL_PREFIX=$(brew --prefix) +command -v brew &>/dev/null && LOCAL_PREFIX="$(brew --prefix)" export MANPATH="$(MANPATH='' manpath)" export PAGER=less export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/startup.py"