error handling for multiple file input
This commit is contained in:
parent
3bca2e429c
commit
3e6fb6a1d7
|
@ -29,7 +29,9 @@ function init_import() {
|
||||||
# create a zip archive if there are multiple files
|
# create a zip archive if there are multiple files
|
||||||
if [[ ${#files[@]} -gt 1 ]]; then
|
if [[ ${#files[@]} -gt 1 ]]; then
|
||||||
file="$tmpdir/Untitled.zip"
|
file="$tmpdir/Untitled.zip"
|
||||||
zip "$file" "${files[@]}"
|
if ! zip --quiet --must-match "$file" "${files[@]}"; then
|
||||||
|
error "creating zip archive with ${files[*]} failed!"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
file="${files[0]}"
|
file="${files[0]}"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue