mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-07-07 09:05:09 +00:00
Handle non-specific file types in start-utils extraction logic (#4121)
This commit is contained in:
@@ -560,6 +560,17 @@ function extract() {
|
|||||||
# remaining args are paths within the archive to extract; if none, extract everything
|
# remaining args are paths within the archive to extract; if none, extract everything
|
||||||
|
|
||||||
type=$(file -b --mime-type "${src}")
|
type=$(file -b --mime-type "${src}")
|
||||||
|
if [[ "$type" == application/octet-stream ]]; then
|
||||||
|
logWarning "Detected non-specific file type $type for $src"
|
||||||
|
case "$src" in
|
||||||
|
*.zip)
|
||||||
|
log "Assuming zip from extension"
|
||||||
|
type=application/zip
|
||||||
|
;;
|
||||||
|
# otherwise fall through to
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
case "${type}" in
|
case "${type}" in
|
||||||
application/zip)
|
application/zip)
|
||||||
unzip -o -q -d "${destDir}" "${src}" "$@"
|
unzip -o -q -d "${destDir}" "${src}" "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user