mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-10-17 17:18:11 +00:00
feat: support WORLD files in compressed tar format (#1297)
This commit is contained in:
1 parent
09834c289a
commit
18d8aba20f
18 files changed
+123
-65
No files matched your search
@@ -188,4 +188,19 @@ function isType() {
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
function extract() {
|
||||
src=${1?}
|
||||
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
|
||||
}
|
||||
Reference in new issue
Block a user