Skip to content

Commit 2324d96

Browse files
committed
refactor: quote expansions and add ShellCheck directive
- Quote URL argument passed to web_pipe in quickget to prevent word-splitting - Quote echoed variables in quickget (echo "${...}") for safe output when values contain whitespace - Add shellcheck disable=SC2054 in quickemu vm_boot to silence a spurious ShellCheck warning Signed-off-by: Martin Wimpress <martin@wimpress.org>
1 parent 1991306 commit 2324d96

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

quickemu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1820,6 +1820,7 @@ function vm_boot() {
18201820
if [ "${secureboot}" == "on" ]; then
18211821
args+=(-global driver=cfi.pflash01,property=secure,value=on)
18221822
fi
1823+
# shellcheck disable=SC2054
18231824
args+=(-drive if=pflash,format="${EFI_CODE_FORMAT}",unit=0,file="${EFI_CODE}",readonly=on
18241825
-drive if=pflash,format="${EFI_VARS_FORMAT}",unit=1,file="${EFI_VARS}")
18251826
fi

quickget

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -900,9 +900,9 @@ function releases_easyos() {
900900
# get the latest 2 years of releases so that when we hit next year we still have the latest 2 years
901901
TWO_YEARS=$(web_pipe https://distro.ibiblio.org/easyos/amd64/releases/kirkstone/ | grep -o -E '[[:digit:]]{4}/' | sort -nr | tr -d / | head -n 2 )
902902
for YEAR in ${TWO_YEARS} ; do
903-
ALL_RELEASES="${ALL_RELEASES} $(web_pipe https://distro.ibiblio.org/easyos/amd64/releases/kirkstone/${YEAR}/ | grep -o -E '[[:digit:]]+(\.[[:digit:]])+/' | tr -d / | sort -nr)"
903+
ALL_RELEASES="${ALL_RELEASES} $(web_pipe "https://distro.ibiblio.org/easyos/amd64/releases/kirkstone/${YEAR}/" | grep -o -E '[[:digit:]]+(\.[[:digit:]])+/' | tr -d / | sort -nr)"
904904
done
905-
echo ${ALL_RELEASES}
905+
echo "${ALL_RELEASES}"
906906
}
907907

908908

@@ -1127,7 +1127,7 @@ function releases_parrotsec() {
11271127
RELEASES="${RELEASES} ${REL}"
11281128
fi
11291129
done
1130-
echo ${RELEASES}
1130+
echo "${RELEASES}"
11311131
}
11321132

11331133
function editions_parrotsec() {

0 commit comments

Comments
 (0)