feat: support WORLD files in compressed tar format (#1297)

This commit is contained in:
Geoff Bourne
2022-01-23 22:19:25 -06:00
committed by GitHub
parent 09834c289a
commit 18d8aba20f
18 changed files with 123 additions and 65 deletions

View File

@@ -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
}