From 2926dba99197d9332b4952f461d26ea86a095928 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Wed, 20 Sep 2023 10:18:42 -0600 Subject: [PATCH] Make shellcheck happier --- install.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/install.sh b/install.sh index cf2086b..235d472 100755 --- a/install.sh +++ b/install.sh @@ -7,10 +7,10 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" here=$(pwd) -pushd $DIR +pushd "$DIR" || exit 255 rm -f .root -echo "$(pwd)" > .root -popd +pwd > .root +popd || exit 255 ret=0 @@ -20,26 +20,26 @@ ret=0 for i in _reformat-common.bash do-reformat.sh would-reformat.sh .root; do if [[ -f "$here"/bin/"$i" ]] ; then - dest=$(readlink bin/$i) - if [[ x"$dest" == x"$DIR/$i" ]] ; then - echo $i is in place, good + dest=$(readlink bin/"$i") + if [[ "$dest" == "$DIR/$i" ]] ; then + echo "$i" is in place, good else - echo $i exists but it is not a symlink or does not point to the right place - echo If it is a symlink, it points to: $dest + echo "$i" exists but it is not a symlink or does not point to the right place + echo If it is a symlink, it points to: "$dest" echo "(If it doesn't point anywhere, then it probably is not a symlink)" ret=1 fi else # it doesn't exist; create it - echo setting $i up - mkdir -p $here/bin - ln -s $DIR/$i $here/bin/$i + echo setting "$i" up + mkdir -p "$here"/bin + ln -s "$DIR"/"$i" "$here"/bin/"$i" fi done if [[ -f $here/.dir-locals.el ]] ; then dest=$(readlink .dir-locals.el) - if [[ x"$dest" == x"$DIR/_dir-locals.el" ]] ; then + if [[ "$dest" == "$DIR/_dir-locals.el" ]] ; then echo .dir-locals.el is in place, good else echo .dir-locals.el exists but it is not a symlink or does not point to @@ -51,7 +51,7 @@ if [[ -f $here/.dir-locals.el ]] ; then fi else echo setting .dir-locals.el up - ln -s $DIR/_dir-locals.el $here/.dir-locals.el + ln -s "$DIR"/_dir-locals.el "$here"/.dir-locals.el fi exit $ret