Make shellcheck happier

This commit is contained in:
Michael Wolf
2023-09-20 10:18:42 -06:00
parent 9966d65489
commit 2926dba991

View File

@@ -7,10 +7,10 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
here=$(pwd) here=$(pwd)
pushd $DIR pushd "$DIR" || exit 255
rm -f .root rm -f .root
echo "$(pwd)" > .root pwd > .root
popd popd || exit 255
ret=0 ret=0
@@ -20,26 +20,26 @@ ret=0
for i in _reformat-common.bash do-reformat.sh would-reformat.sh .root; do for i in _reformat-common.bash do-reformat.sh would-reformat.sh .root; do
if [[ -f "$here"/bin/"$i" ]] ; then if [[ -f "$here"/bin/"$i" ]] ; then
dest=$(readlink bin/$i) dest=$(readlink bin/"$i")
if [[ x"$dest" == x"$DIR/$i" ]] ; then if [[ "$dest" == "$DIR/$i" ]] ; then
echo $i is in place, good echo "$i" is in place, good
else else
echo $i exists but it is not a symlink or does not point to the right place 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 is a symlink, it points to: "$dest"
echo "(If it doesn't point anywhere, then it probably is not a symlink)" echo "(If it doesn't point anywhere, then it probably is not a symlink)"
ret=1 ret=1
fi fi
else else
# it doesn't exist; create it # it doesn't exist; create it
echo setting $i up echo setting "$i" up
mkdir -p $here/bin mkdir -p "$here"/bin
ln -s $DIR/$i $here/bin/$i ln -s "$DIR"/"$i" "$here"/bin/"$i"
fi fi
done done
if [[ -f $here/.dir-locals.el ]] ; then if [[ -f $here/.dir-locals.el ]] ; then
dest=$(readlink .dir-locals.el) 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 echo .dir-locals.el is in place, good
else else
echo .dir-locals.el exists but it is not a symlink or does not point to 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 fi
else else
echo setting .dir-locals.el up 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 fi
exit $ret exit $ret