-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup shellcheck and fix all issues #189
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
shellcheck
🚫 [shellcheck] reported by reviewdog 🐶
SIGKILL/SIGSTOP can not be trapped. SC2173
Line 238 in ff8a494
trap bailout 1 2 3 3 6 9 14 15 |
[shellcheck] reported by reviewdog 🐶
expr is antiquated. Consider rewriting this using
Line 278 in ff8a494
local FILL=$(expr "$COUNT" - "$1") |
Declare and assign separately to avoid masking return values. SC2155
Line 281 in ff8a494
local FILL=$(expr "$FILL" - 1) |
[shellcheck] reported by reviewdog 🐶
expr is antiquated. Consider rewriting this using
Line 281 in ff8a494
local FILL=$(expr "$FILL" - 1) |
Declare and assign separately to avoid masking return values. SC2155
Line 285 in ff8a494
local FILL=$(expr "$FILL" + 1) |
[shellcheck] reported by reviewdog 🐶
expr is antiquated. Consider rewriting this using
Line 285 in ff8a494
local FILL=$(expr "$FILL" + 1) |
[shellcheck] reported by reviewdog 🐶
Line 415 in ff8a494
shift $(($OPTIND - 1)) # set ARGV to the first not parsed commandline parameter |
📝 [shellcheck] reported by reviewdog 🐶
Use '[:lower:]' to support accents and foreign alphabets. SC2018
Line 451 in ff8a494
[ -n "$CLASSES" ] || CLASSES="GRMLBASE,GRML_FULL,$(echo "${ARCH}" | tr 'a-z' 'A-Z')" |
📝 [shellcheck] reported by reviewdog 🐶
Use '[:upper:]' to support accents and foreign alphabets. SC2019
Line 451 in ff8a494
[ -n "$CLASSES" ] || CLASSES="GRMLBASE,GRML_FULL,$(echo "${ARCH}" | tr 'a-z' 'A-Z')" |
Declare and assign separately to avoid masking return values. SC2155
Line 495 in ff8a494
[ -n "$GRML_NAME" ] && export SHORT_NAME="$(echo "$GRML_NAME" | tr -d ',./;\- ')" |
📝 [shellcheck] reported by reviewdog 🐶
read without -r will mangle backslashes. SC2162
Line 558 in ff8a494
read a |
Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. SC2166
Line 559 in ff8a494
if ! [ "$a" = 'y' -o "$a" = 'Y' ] ; then |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 571 in ff8a494
[ -n "${CHROOT_OUTPUT}" -a -d "${CHROOT_OUTPUT}" ] && rm -r "${CHROOT_OUTPUT}" |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 572 in ff8a494
[ -n "${BUILD_OUTPUT}" -a -d "${BUILD_OUTPUT}" ] && rm -r "${BUILD_OUTPUT}" |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 573 in ff8a494
[ -n "${ISO_OUTPUT}" -a -d "${ISO_OUTPUT}" ] && rm -r "${ISO_OUTPUT}" |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 574 in ff8a494
[ -n "${LOG_OUTPUT}" -a -d "${LOG_OUTPUT}" ] && rm -r "${LOG_OUTPUT}" |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 575 in ff8a494
[ -n "${NETBOOT}" -a -d "${NETBOOT}" ] && rm -r "${NETBOOT}" |
Declare and assign separately to avoid masking return values. SC2155
Line 644 in ff8a494
local tempdir=$(mktemp -d) |
Don't use ls | grep. Use a glob or a for loop with a condition to allow non-alphanumeric filenames. SC2010
Line 656 in ff8a494
if ls "${tempdir}"/live/*/*.squashfs 2>/dev/null | grep -q . ; then |
📝 [shellcheck] reported by reviewdog 🐶
Use '[:lower:]' to support accents and foreign alphabets. SC2018
Line 687 in ff8a494
*) CLASSES="DEBIAN_$(echo "$SUITE" | tr 'a-z' 'A-Z'),$CLASSES";; |
📝 [shellcheck] reported by reviewdog 🐶
Use '[:upper:]' to support accents and foreign alphabets. SC2019
Line 687 in ff8a494
*) CLASSES="DEBIAN_$(echo "$SUITE" | tr 'a-z' 'A-Z'),$CLASSES";; |
Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. SC2166
Line 754 in ff8a494
if [ -n "$UPDATE" -o -n "$BUILD_ONLY" ] ; then |
Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. SC2166
Line 760 in ff8a494
if [ -n "$UPDATE" -o -n "$BUILD_ONLY" ] ; then |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 769 in ff8a494
if [ -d "$CHROOT_OUTPUT/bin" -a -z "$UPDATE" -a -z "$BUILD_ONLY" ] ; then |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 769 in ff8a494
if [ -d "$CHROOT_OUTPUT/bin" -a -z "$UPDATE" -a -z "$BUILD_ONLY" ] ; then |
Expanding an array without an index only gives the first element. SC2128
Line 788 in ff8a494
RC="$PIPESTATUS" # notice: bash-only |
📝 [shellcheck] reported by reviewdog 🐶
To read lines rather than words, pipe/redirect to a 'while read' loop. SC2013
Line 898 in ff8a494
for package in $(awk '{print $1}' "${CHECKLOG}/package_errors.log" | sed 's;/;\\/;') ; do |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 918 in ff8a494
if [ -n "$EXIT_ON_MISSING_PACKAGES" -a -z "$BUILD_DIRTY" ] ; then |
Declare and assign separately to avoid masking return values. SC2155
Line 995 in ff8a494
local GRUBCFG_TMP=$(mktemp) |
Don't use ls | grep. Use a glob or a for loop with a condition to allow non-alphanumeric filenames. SC2010
Line 1081 in ff8a494
INITRD=$(ls "$CHROOT_OUTPUT/boot/initrd*" 2>/dev/null| grep -v '.bak$' | sort -r | head -1) |
📝 [shellcheck] reported by reviewdog 🐶
Use find instead of ls to better handle non-alphanumeric filenames. SC2012
Line 1091 in ff8a494
KERNEL_IMAGE=$(ls "$CHROOT_OUTPUT/boot/vmlinuz*" 2>/dev/null | sort -r | head -1) |
This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten. SC2320
Line 1111 in ff8a494
eend $? |
This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten. SC2320
Line 1130 in ff8a494
eend $? |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 1136 in ff8a494
if [ -r "${CHROOT_OUTPUT}/boot/efi.img" -a -r "${CHROOT_OUTPUT}/boot/bootaa64.efi" ] ; then |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 1144 in ff8a494
elif [ -r "${CHROOT_OUTPUT}/boot/efi.img" -a -r "${CHROOT_OUTPUT}/boot/bootx64.efi" ] ; then |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 1152 in ff8a494
elif [ -r "${CHROOT_OUTPUT}/boot/efi.img" -a -r "${CHROOT_OUTPUT}/boot/bootia32.efi" ] ; then |
For loops over find output are fragile. Use find -exec or a while read loop. SC2044
Line 1349 in ff8a494
for file in $(find "${BUILD_OUTPUT}" -name "*%$param%*") ; do |
[shellcheck] reported by reviewdog 🐶
Consider using { cmd1; cmd2; } >> file instead of individual redirects. SC2129
Line 1377 in ff8a494
echo "include isoprompt.cfg" >> "${BUILD_OUTPUT}/boot/isolinux/grmlmain.cfg" |
This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten. SC2320
Line 1409 in ff8a494
eend $? |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 1463 in ff8a494
if [ -f "$BUILD_OUTPUT"/live/"${GRML_NAME}".squashfs -a -z "$UPDATE" -a -z "$BUILD_ONLY" -a -z "$BUILD_DIRTY" ] ; then |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 1463 in ff8a494
if [ -f "$BUILD_OUTPUT"/live/"${GRML_NAME}".squashfs -a -z "$UPDATE" -a -z "$BUILD_ONLY" -a -z "$BUILD_DIRTY" ] ; then |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 1463 in ff8a494
if [ -f "$BUILD_OUTPUT"/live/"${GRML_NAME}".squashfs -a -z "$UPDATE" -a -z "$BUILD_ONLY" -a -z "$BUILD_DIRTY" ] ; then |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 1497 in ff8a494
if [ -n "$SQUASHFS_EXCLUDES_FILE" -a "$SQUASHFS_EXCLUDES_FILE" ] ; then |
📝 [shellcheck] reported by reviewdog 🐶
Make sure not to read and write the same file in the same pipeline. SC2094
Line 1536 in ff8a494
find ../.. -type f -not -name md5sums -not -name isolinux.bin -exec md5sum {} \; > md5sums ) |
📝 [shellcheck] reported by reviewdog 🐶
Make sure not to read and write the same file in the same pipeline. SC2094
Line 1536 in ff8a494
find ../.. -type f -not -name md5sums -not -name isolinux.bin -exec md5sum {} \; > md5sums ) |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 1607 in ff8a494
if [ -f "${ISO_OUTPUT}/${ISO_NAME}" -a -z "$UPDATE" -a -z "$BUILD_ONLY" -a -z "$BUILD_DIRTY" -a "$FORCE_ISO_REBUILD" = "false" ] ; then |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 1607 in ff8a494
if [ -f "${ISO_OUTPUT}/${ISO_NAME}" -a -z "$UPDATE" -a -z "$BUILD_ONLY" -a -z "$BUILD_DIRTY" -a "$FORCE_ISO_REBUILD" = "false" ] ; then |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 1607 in ff8a494
if [ -f "${ISO_OUTPUT}/${ISO_NAME}" -a -z "$UPDATE" -a -z "$BUILD_ONLY" -a -z "$BUILD_DIRTY" -a "$FORCE_ISO_REBUILD" = "false" ] ; then |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 1607 in ff8a494
if [ -f "${ISO_OUTPUT}/${ISO_NAME}" -a -z "$UPDATE" -a -z "$BUILD_ONLY" -a -z "$BUILD_DIRTY" -a "$FORCE_ISO_REBUILD" = "false" ] ; then |
Use 'cd ... || exit' or 'cd ... || return' in case cd fails. SC2164
Line 1691 in ff8a494
cd "$CURRENT_DIR" |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 1709 in ff8a494
if [ -f "${OUTPUT_FILE}" -a -z "$UPDATE" -a -z "$BUILD_ONLY" -a -z "$BUILD_DIRTY" ] ; then |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 1709 in ff8a494
if [ -f "${OUTPUT_FILE}" -a -z "$UPDATE" -a -z "$BUILD_ONLY" -a -z "$BUILD_DIRTY" ] ; then |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 1709 in ff8a494
if [ -f "${OUTPUT_FILE}" -a -z "$UPDATE" -a -z "$BUILD_ONLY" -a -z "$BUILD_DIRTY" ] ; then |
Use 'cd ... || exit' or 'cd ... || return' in case cd fails. SC2164
Line 1811 in ff8a494
cd "$(dirname "${OUTPUT_FILE}")" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
shellcheck
Don't use ls | grep. Use a glob or a for loop with a condition to allow non-alphanumeric filenames. SC2010
Line 656 in 9e89e1a
if ls "${tempdir}"/live/*/*.squashfs 2>/dev/null | grep -q . ; then |
Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. SC2166
Line 754 in 9e89e1a
if [ -n "$UPDATE" -o -n "$BUILD_ONLY" ] ; then |
Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. SC2166
Line 760 in 9e89e1a
if [ -n "$UPDATE" -o -n "$BUILD_ONLY" ] ; then |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 769 in 9e89e1a
if [ -d "$CHROOT_OUTPUT/bin" -a -z "$UPDATE" -a -z "$BUILD_ONLY" ] ; then |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 769 in 9e89e1a
if [ -d "$CHROOT_OUTPUT/bin" -a -z "$UPDATE" -a -z "$BUILD_ONLY" ] ; then |
📝 [shellcheck] reported by reviewdog 🐶
To read lines rather than words, pipe/redirect to a 'while read' loop. SC2013
Line 898 in 9e89e1a
for package in $(awk '{print $1}' "${CHECKLOG}/package_errors.log" | sed 's;/;\\/;') ; do |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 918 in 9e89e1a
if [ -n "$EXIT_ON_MISSING_PACKAGES" -a -z "$BUILD_DIRTY" ] ; then |
Declare and assign separately to avoid masking return values. SC2155
Line 995 in 9e89e1a
local GRUBCFG_TMP=$(mktemp) |
This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten. SC2320
Line 1111 in 9e89e1a
eend $? |
This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten. SC2320
Line 1130 in 9e89e1a
eend $? |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 1136 in 9e89e1a
if [ -r "${CHROOT_OUTPUT}/boot/efi.img" -a -r "${CHROOT_OUTPUT}/boot/bootaa64.efi" ] ; then |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 1144 in 9e89e1a
elif [ -r "${CHROOT_OUTPUT}/boot/efi.img" -a -r "${CHROOT_OUTPUT}/boot/bootx64.efi" ] ; then |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 1152 in 9e89e1a
elif [ -r "${CHROOT_OUTPUT}/boot/efi.img" -a -r "${CHROOT_OUTPUT}/boot/bootia32.efi" ] ; then |
[shellcheck] reported by reviewdog 🐶
Consider using { cmd1; cmd2; } >> file instead of individual redirects. SC2129
Line 1377 in 9e89e1a
echo "include isoprompt.cfg" >> "${BUILD_OUTPUT}/boot/isolinux/grmlmain.cfg" |
This $? refers to echo/printf, not a previous command. Assign to variable to avoid it being overwritten. SC2320
Line 1409 in 9e89e1a
eend $? |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 1497 in 9e89e1a
if [ -n "$SQUASHFS_EXCLUDES_FILE" -a "$SQUASHFS_EXCLUDES_FILE" ] ; then |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 1607 in 9e89e1a
if [ -f "${ISO_OUTPUT}/${ISO_NAME}" -a -z "$UPDATE" -a -z "$BUILD_ONLY" -a -z "$BUILD_DIRTY" -a "$FORCE_ISO_REBUILD" = "false" ] ; then |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 1607 in 9e89e1a
if [ -f "${ISO_OUTPUT}/${ISO_NAME}" -a -z "$UPDATE" -a -z "$BUILD_ONLY" -a -z "$BUILD_DIRTY" -a "$FORCE_ISO_REBUILD" = "false" ] ; then |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 1607 in 9e89e1a
if [ -f "${ISO_OUTPUT}/${ISO_NAME}" -a -z "$UPDATE" -a -z "$BUILD_ONLY" -a -z "$BUILD_DIRTY" -a "$FORCE_ISO_REBUILD" = "false" ] ; then |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 1607 in 9e89e1a
if [ -f "${ISO_OUTPUT}/${ISO_NAME}" -a -z "$UPDATE" -a -z "$BUILD_ONLY" -a -z "$BUILD_DIRTY" -a "$FORCE_ISO_REBUILD" = "false" ] ; then |
Use 'cd ... || exit' or 'cd ... || return' in case cd fails. SC2164
Line 1691 in 9e89e1a
cd "$CURRENT_DIR" |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 1709 in 9e89e1a
if [ -f "${OUTPUT_FILE}" -a -z "$UPDATE" -a -z "$BUILD_ONLY" -a -z "$BUILD_DIRTY" ] ; then |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 1709 in 9e89e1a
if [ -f "${OUTPUT_FILE}" -a -z "$UPDATE" -a -z "$BUILD_ONLY" -a -z "$BUILD_DIRTY" ] ; then |
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2166
Line 1709 in 9e89e1a
if [ -f "${OUTPUT_FILE}" -a -z "$UPDATE" -a -z "$BUILD_ONLY" -a -z "$BUILD_DIRTY" ] ; then |
596da04
to
fe3eef9
Compare
Running a local test build right now. I hope I didn't break anything, but not super confident. |
FWIW: We've been using https://github.com/redhat-plumbers-in-action/differential-shellcheck which has the benefit of only failing on newly added violations, not on existing offenses |
Ah, very cool. I've "just" fixed all issues ;-) |
Yeah, I'm never that motivated when working with shell ;) |
This found an issue or two which I've fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for delay, had to find some proper time to go through all of this :)
Thanks a bunch for working on this, only some small nitpicks and two bugs, other than that LGTM!
scripts/generate_netboot_package.sh
Outdated
@@ -43,7 +43,7 @@ cat > "${WORKING_DIR}/pxelinux.cfg/default" << EOF | |||
default grml | |||
label grml | |||
kernel vmlinuz | |||
append initrd=initrd.img root=/dev/nfs rw nfsroot=192.168.0.1:/live/image boot=live apm=power-off quiet nomce noprompt noeject vga=791 net.ifnames=0 | |||
append initrd=initrd.img root=/dev/nfs rw nfsroot=192.168.0.1:/live/image boot=live apm=power-off quiet nomce noprompt noeject vga=791 net.ifnames=0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please don't drop the trailing whitespace char here (it's relevant when e.g. someone wants to append something like ssh=foobar
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack, that was an overzealous text editor and an oversight on my part.
@@ -23,17 +26,17 @@ if [ "$FAI_ACTION" = "softupdate" ] ; then | |||
|
|||
# /etc/resolv.conf is usually a symlink, pointing out of the chroot. | |||
# Make it a file with known contents. | |||
rm -f "${target}"/etc/resolv.conf | |||
rm -f "$target"/etc/resolv.conf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we have a strange mixture of "${target}"
vs "$target"
now :p
(I'm aware that this is inconsistent over all the code base, nowadays I prefer to use "$f"
and "${foo}"
(so no ${}
for single char variables, whereas ${}
for >=2 chars)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I tried to aim for some local consistency... at some point I gave up. We need to make a call and then update all places in one go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nod :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed at least instsoft.GRMLBASE to be in one style overall.
@@ -29,9 +32,10 @@ echo "$0: Installing latest kernel and its headers, as well as build-essential." | |||
# keeping track of what gets installed. This is an ugly hack and should not | |||
# be needed, but without it the resulting ISO is hundreds of megabytes | |||
# larger. I hope this kludge can go away eventually. | |||
extra_packages=($($ROOTCMD apt-get --assume-no --download-only --mark-auto -u install \ | |||
mapfile -t extra_packages <($ROOTCMD \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't work, AFAICT, needs to be:
mapfile -t extra_packages < <($ROOTCMD ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. It also needs some extra sed to actually work. Fixed both instances.
@@ -54,7 +58,11 @@ else | |||
fi | |||
|
|||
echo "$0: Installing zfs-dkms itself." | |||
extra_packages=(${extra_packages[@]} $($ROOTCMD apt-get --assume-no --download-only --mark-auto -u install zfs-dkms | sed '0,/The following NEW packages will be installed/d;/^[^ ]/,$d')) | |||
mapfile -t zfs_packages <($ROOTCMD \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed as above
Used by init-functions. Until we replace that, add this annotation.
AFAICT nothing uses SHORT_NAME outside of grml-live itself.
Declare and assign separately to avoid masking return values.
read without -r will mangle backslashes. Not relevant here.
$/${} is unnecessary on arithmetic variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM! 🥳
Setup shellcheck in GitHub Actions and fix all reported issues.