~cyplo/dotfiles

ref: 83ddcc09dc68389b129d598722eca9e90a6dff33 dotfiles/tools/decompress -rwxr-xr-x 294 bytes
83ddcc09 — Cyryl Płotnicki remove broken i3 msg call 1 year, 10 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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"