Handle non-specific file types in start-utils extraction logic

Also:
- assume zip type based on file extension when applicable
This commit is contained in:
Geoff Bourne
2026-06-22 10:59:28 -05:00
parent 737a9879f7
commit 2fc873c01b
+11
View File
@@ -560,6 +560,17 @@ function extract() {
# remaining args are paths within the archive to extract; if none, extract everything
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
application/zip)
unzip -o -q -d "${destDir}" "${src}" "$@"