···6Options:
7 --url url The url of the archive to fetch.
8 --name name The name to use for the store path (defaults to \`basename \$url\`).
09 --hash hash The hash of unpacked archive.
10 --hash-type type Use the specified cryptographic hash algorithm, which can be one of md5, sha1, and sha256.
11 --leave-root Keep the root directory of the archive.
···161718name=""
019argi=0
20argfun=""
21for arg; do
···23 case $arg in
24 --url) argfun=set_url;;
25 --name) argfun=set_name;;
026 --hash) argfun=set_expHash;;
27 --hash-type) argfun=set_hashType;;
28 --leave-root) leaveRoot=true;;
···67tmp=$(mktemp -d 2>/dev/null || mktemp -d -t "$$")
68trap "rm -rf '$tmp'" EXIT
6970-unpackDirTmp=$tmp/unpacked-tmp/$name
0071mkdir -p $unpackDirTmp
7273-unpackDir=$tmp/unpacked/$name
74mkdir -p $unpackDir
7576downloadedFile=$tmp/$(basename "$url")
···6Options:
7 --url url The url of the archive to fetch.
8 --name name The name to use for the store path (defaults to \`basename \$url\`).
9+ --ext ext The file extension (.zip, .tar.gz, ...) to be REMOVED from name
10 --hash hash The hash of unpacked archive.
11 --hash-type type Use the specified cryptographic hash algorithm, which can be one of md5, sha1, and sha256.
12 --leave-root Keep the root directory of the archive.
···171819name=""
20+ext=""
21argi=0
22argfun=""
23for arg; do
···25 case $arg in
26 --url) argfun=set_url;;
27 --name) argfun=set_name;;
28+ --ext) argfun=set_ext;;
29 --hash) argfun=set_expHash;;
30 --hash-type) argfun=set_hashType;;
31 --leave-root) leaveRoot=true;;
···70tmp=$(mktemp -d 2>/dev/null || mktemp -d -t "$$")
71trap "rm -rf '$tmp'" EXIT
7273+dirname=$(basename -s "$ext" "$name")
74+75+unpackDirTmp=$tmp/unpacked-tmp/$dirname
76mkdir -p $unpackDirTmp
7778+unpackDir=$tmp/unpacked/$dirname
79mkdir -p $unpackDir
8081downloadedFile=$tmp/$(basename "$url")