website-build: build.sh: make it pass shellcheck.

Without that fix, shellcheck -x complains a lot:
    In build.sh line 53:
    mkdir -p "$(dirname ${dst_path})"
                        ^---------^
    SC2086 (info): Double quote to prevent globbing and word splitting.

    In build.sh line 82:
    git -C "${dst_path}" am $(realpath ${patch})
                            ^------------------^
    SC2046 (warning): Quote this to prevent word splitting.
    git -C "${dst_path}" am $(realpath ${patch})
                                       ^------^
    SC2086 (info): Double quote to prevent globbing and word splitting.

    In build.sh line 112:
    opt="$(eval echo \$$i)"
                       ^--
    SC2086 (info): Double quote to prevent globbing and word splitting.

    In build.sh line 127:
    untitled_path="$(eval echo \$$(expr $i + 1))"
                                 ^------------^
    SC2046 (warning): Quote this to prevent word splitting.
    untitled_path="$(eval echo \$$(expr $i + 1))"
                                   ^--^
    SC2003 (style): expr is antiquated.
    Consider rewriting this using $((..)), ${} or [[ ]].
    untitled_path="$(eval echo \$$(expr $i + 1))"
                                        ^--
    SC2086 (info): Double quote to prevent globbing and word splitting.

    In build.sh line 128:
    i="$(expr "$i" + 1)"
         ^--^
    SC2003 (style): expr is antiquated.
    Consider rewriting this using $((..)), ${} or [[ ]].

    In build.sh line 136:
    i="$(expr "$i" + 1)"
         ^--^
    SC2003 (style): expr is antiquated.
    Consider rewriting this using $((..)), ${} or [[ ]].

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
This commit is contained in:
Denis 'GNUtoo' Carikli 2024-05-21 15:45:14 +02:00
parent d13f8ecf50
commit 491225f38a
Signed by: GNUtoo
GPG Key ID: 5F5DFCC14177E263
2 changed files with 6 additions and 5 deletions

View File

@ -66,6 +66,7 @@ run_shellcheck \
resources/scripts/tasks/distclean.sh \
tests/distclean \
tests/lint \
website-build/build.sh \
website-build/check.sh
printf "+---------------------+\n"

View File

@ -50,7 +50,7 @@ sync_repo()
git clone "${src_uri}" "${dst_path}"
git -C "${dst_path}" checkout "${src_revision}"
elif [ ! -d "${dst_path}" ] ; then
mkdir -p "$(dirname ${dst_path})"
mkdir -p "$(dirname "${dst_path}")"
cp -a "${src_path}" "${dst_path}"
if [ -n "${src_revision}" ] ; then
git -C "${dst_path}" checkout "${src_revision}"
@ -79,7 +79,7 @@ sync_repo()
for patch in ${src_patches} ; do
GIT_COMMITTER_EMAIL="noreply@gnuboot.gnu.org" \
GIT_COMMITTER_NAME="website-build" \
git -C "${dst_path}" am $(realpath ${patch})
git -C "${dst_path}" am "$(realpath "${patch}")"
done
else
rm -rf "${dst_path}"
@ -124,8 +124,8 @@ while [ "$i" -le $# ] ; do
help_missing_arg "--with-untitled-path"
exit ${EX_USAGE}
fi
untitled_path="$(eval echo \$$(expr $i + 1))"
i="$(expr "$i" + 1)"
untitled_path="$(eval echo \$$((i + 1)))"
i="$((i + 1))"
;;
*)
help
@ -133,7 +133,7 @@ while [ "$i" -le $# ] ; do
;;
esac
i="$(expr "$i" + 1)"
i="$((i + 1))"
done
set -e