Commit: ab38d5e4e39c493d3a06f4bc5d88fccbd5464cc2
Parent: a3ecc42f58130d1c14aad6ed541e9c77b467211f
Author: Randy Palamar
Date: Wed, 11 Jan 2023 19:34:56 -0700
unpack: check if dir exists before mkdir
the original worked fine on musl but its broken on glibc
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/unpack b/bin/unpack
@@ -23,7 +23,7 @@ case "$#" in
esac
[ -f "$1" ] || die "unpack: $1: not a regular file"
-mkdir "$2" >/dev/null 2>&1 || die "unpack: $2: not a directory"
+[ -d "$2" ] || mkdir "$2" >/dev/null 2>&1 || die "unpack: $2: not a directory"
case $(file -ib -- "$1" | cut -d ';' -f 1 | cut -d '/' -f 2) in
bzip2|x-bzip2) run bzip2 -dc "$1" | tar -C "$2" -x ;;