mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-10-09 21:57:12 +00:00
Fix loading world from compressed tar archives (#1304)
This commit is contained in:
1 parent
d02bbb798e
commit
8a42dfe232
14 files changed
+60
-10
No files matched your search
+13
-9
@@ -195,12 +195,16 @@ function extract() {
|
||||
destDir=${2?}
|
||||
|
||||
type=$(file -b --mime-type "${src}")
|
||||
if [[ $type == application/zip ]]; then
|
||||
unzip -q -d "${destDir}" "${src}"
|
||||
elif [[ $type == application/x-tar ]]; then
|
||||
tar -C "${destDir}" -xf "${src}"
|
||||
else
|
||||
log "ERROR: unsupported archive type: $type"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
case "${type}" in
|
||||
application/zip)
|
||||
unzip -q -d "${destDir}" "${src}"
|
||||
;;
|
||||
application/x-tar|application/gzip|application/x-bzip2|application/zstd)
|
||||
tar -C "${destDir}" -xf "${src}"
|
||||
;;
|
||||
*)
|
||||
log "ERROR: unsupported archive type: $type"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
Reference in new issue
Block a user