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)
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