warp4j: Allow JARs with script header

Fixes https://github.com/guziks/warp4j/issues/2
This commit is contained in:
John Vandenberg 2022-04-25 15:36:23 +08:00
parent aeffdc3eb5
commit ea229d2775

3
warp4j
View File

@ -341,7 +341,8 @@ fi
# checking file is actually java archive # checking file is actually java archive
if ([[ $(file $JAR) != *"Java"* ]] && # it could be "Java archive data" or "Java Jar file data (zip)" if ([[ $(file $JAR) != *"Java"* ]] && # it could be "Java archive data" or "Java Jar file data (zip)"
[[ $(file $JAR) != *"Zip"* ]]) || # or "Zip archive data" [[ $(file $JAR) != *"Zip"* ]] && # or "Zip archive data"
[[ $(file $JAR) != *"POSIX shell script executable (binary data)"* ]]) || # or JAR embedded in POSIX script
[[ $JAR_EXTENSION_LOWERCASE != "jar" ]]; then [[ $JAR_EXTENSION_LOWERCASE != "jar" ]]; then
fail_with "File \"$JAR\" is not a java archive" fail_with "File \"$JAR\" is not a java archive"
fi fi