Skip to content

Commit 2ecf677

Browse files
authored
Handle non-specific file types in start-utils extraction logic (#4121)
1 parent dadecda commit 2ecf677

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

scripts/start-utils

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,17 @@ function extract() {
560560
# remaining args are paths within the archive to extract; if none, extract everything
561561

562562
type=$(file -b --mime-type "${src}")
563+
if [[ "$type" == application/octet-stream ]]; then
564+
logWarning "Detected non-specific file type $type for $src"
565+
case "$src" in
566+
*.zip)
567+
log "Assuming zip from extension"
568+
type=application/zip
569+
;;
570+
# otherwise fall through to
571+
esac
572+
fi
573+
563574
case "${type}" in
564575
application/zip)
565576
unzip -o -q -d "${destDir}" "${src}" "$@"

0 commit comments

Comments
 (0)