From 3e6fb6a1d777ef2cb9c0676b13aab283378157dd Mon Sep 17 00:00:00 2001 From: Felix Lohmeier Date: Wed, 20 Apr 2022 09:45:32 +0200 Subject: [PATCH] error handling for multiple file input --- src/lib/init_import.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/init_import.sh b/src/lib/init_import.sh index ba2db6c..3786213 100644 --- a/src/lib/init_import.sh +++ b/src/lib/init_import.sh @@ -29,7 +29,9 @@ function init_import() { # create a zip archive if there are multiple files if [[ ${#files[@]} -gt 1 ]]; then file="$tmpdir/Untitled.zip" - zip "$file" "${files[@]}" + if ! zip --quiet --must-match "$file" "${files[@]}"; then + error "creating zip archive with ${files[*]} failed!" + fi else file="${files[0]}" fi