From 564f8ef1b87399c0d4b798baf83f9d2b95ac77b7 Mon Sep 17 00:00:00 2001 From: Hugo Hromic Date: Mon, 18 Feb 2019 12:54:15 +0000 Subject: Silence shellcheck warnings (#255) * Made more specific shellcheck disables * Fixed variable quoting (SC2086,SC2064) * Use `$*` expansion instead of `$@` when not using arrays (SC2124) * Use cleaner `$()` syntax instead of back quotes (SC2006) * Improved comparator (SC2166) * Minor improvements in coding style Tested clean output using: `find -name "*.sh" | xargs -n1 shellcheck -x`. --- export-noobs/00-release/files/partition_setup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'export-noobs') diff --git a/export-noobs/00-release/files/partition_setup.sh b/export-noobs/00-release/files/partition_setup.sh index e41a9d3..0f45f20 100644 --- a/export-noobs/00-release/files/partition_setup.sh +++ b/export-noobs/00-release/files/partition_setup.sh @@ -3,6 +3,7 @@ set -ex +# shellcheck disable=SC2154 if [ -z "$part1" ] || [ -z "$part2" ]; then printf "Error: missing environment variable part1 or part2\n" 1>&2 exit 1 @@ -17,7 +18,8 @@ sed /tmp/1/cmdline.txt -i -e "s|root=[^ ]*|root=${part2}|" sed /tmp/2/etc/fstab -i -e "s|^[^#].* / |${part2} / |" sed /tmp/2/etc/fstab -i -e "s|^[^#].* /boot |${part1} /boot |" -if [ -z $restore ]; then +# shellcheck disable=SC2154 +if [ -z "$restore" ]; then if [ -f /mnt/ssh ]; then cp /mnt/ssh /tmp/1/ fi -- cgit v1.2.3