Add xz decompress
This commit is contained in:
parent
2c599b69ed
commit
d9dc74131d
1 changed files with 21 additions and 0 deletions
21
tools/decompress
Executable file
21
tools/decompress
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ -z $1 ]; then
|
||||||
|
echo "Usage: $0 file-to-decompress [target-directory]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
file=$1
|
||||||
|
target=$2
|
||||||
|
|
||||||
|
if [ -z $2 ]; then
|
||||||
|
target=`pwd`
|
||||||
|
fi
|
||||||
|
|
||||||
|
target=`realpath $target`
|
||||||
|
|
||||||
|
mkdir -p "$target"
|
||||||
|
|
||||||
|
echo "unpacking $file to $target"
|
||||||
|
pv -erp "$file" | tar vJx - -C "$target"
|
Loading…
Reference in a new issue