diff --git a/copy-firmware.sh b/copy-firmware.sh index 381bde29..fa83492e 100755 --- a/copy-firmware.sh +++ b/copy-firmware.sh @@ -16,6 +16,10 @@ err() { exit 1 } +warn() { + printf "WARNING: %s\n" "$*" +} + while test $# -gt 0; do case $1 in -v | --verbose) @@ -63,6 +67,10 @@ if test -z "$destdir"; then err "destination directory was not specified" fi +if test -d "$destdir"; then + find "$destdir" -type d -empty >/dev/null || warn "destination folder is not empty." +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