From d9dc74131d5a2aca296a0711caa081b5974212e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Fri, 4 May 2018 21:44:52 +0100 Subject: [PATCH] Add xz decompress --- tools/decompress | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 tools/decompress diff --git a/tools/decompress b/tools/decompress new file mode 100755 index 00000000..717a45d2 --- /dev/null +++ b/tools/decompress @@ -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"