nix/home/scripts/common/bin/unarchive

10 lines
253 B
Plaintext
Raw Normal View History

2023-09-05 13:52:52 -05:00
#!/usr/bin/env bash
archive_name="${1}"; shift
to_dir="$(basename "$archive_name")"
mkdir -p "${to_dir}"
pushd "${to_dir}" || ( echo "${to_dir} does not exist" ; exit 1 )
tar --zstd -xvf "${archive_name}"
echo "Unarchived to: ${to_dir}"
popd || exit 2