Bash scripts; use double brackets, fix bare variables, add quotes

These scripts explicitly use Bash, so we should be able to use
`[[` instead of `[` (which seems to be recommended).

Also added curly brackets to some bare variables, and quoted some paths.

This makes my IDE a bit more silent :-)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2018-12-22 20:18:33 +01:00
parent d147fe0582
commit 297b30df5f
43 changed files with 143 additions and 144 deletions

View File

@@ -9,7 +9,7 @@ TMP_GOPATH=${TMP_GOPATH:-""}
: ${PREFIX:="/usr/local/bin"}
if [ -z "$TMP_GOPATH" ]; then
if [[ -z "$TMP_GOPATH" ]]; then
export GOPATH="$(mktemp -d)"
RM_GOPATH=1
else
@@ -21,10 +21,10 @@ dir="$(dirname $0)"
bin=$1
shift
if [ ! -f "${dir}/${bin}.installer" ]; then
if [[ ! -f "${dir}/${bin}.installer" ]]; then
echo "Could not find installer for \"$bin\""
exit 1
fi
. $dir/$bin.installer
install_$bin "$@"
. ${dir}/${bin}.installer
install_${bin} "$@"