From 195eae5962588c588ec1ef8d34a716da008afdb1 Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Wed, 8 Nov 2023 17:13:51 -0600 Subject: [PATCH] Add checks for destination directory being specified Signed-off-by: Mario Limonciello --- copy-firmware.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/copy-firmware.sh b/copy-firmware.sh index 3026c216..cca3913b 100755 --- a/copy-firmware.sh +++ b/copy-firmware.sh @@ -64,6 +64,11 @@ while test $# -gt 0; do esac done +if [ -z "$destdir" ]; then + echo "ERROR: destination directory was not specified" + exit 1 +fi + # shellcheck disable=SC2162 # file/folder name can include escaped symbols grep -E '^(RawFile|File):' WHENCE | sed -E -e 's/^(RawFile|File): */\1 /;s/"//g' | while read k f; do test -f "$f" || continue