Update fix-diffusers-root-directory.sh

This commit is contained in:
Cyberes 2022-11-07 11:33:50 -07:00 committed by GitHub
parent a2e4b9511a
commit fccf07e083
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -5,11 +5,14 @@
# named "archive". This script renames the root directory to "archive".
if [ -z "$1" ]; then echo -e "Usage:\n./fix-diffusers-root-directory.sh [file or directory of files]" && exit 1; fi
TARGET_PATH="$@"
TARGET_PATH="${@%/}"
test_zip () {
unzip -l "$1" > /dev/null
return $?
if file "$1" | grep "Zip archive" > /dev/null 2>&1; then
return 0
else
return 1
fi
}
do_convert () {