From 017ba59ab70abe9eb90177efe09f73b833a39c1a Mon Sep 17 00:00:00 2001 From: Deposite Pirate Date: Thu, 23 Oct 2025 07:36:55 +0200 Subject: Improve compression utils modified: conf.d/05z.fish new file: functions/7za.fish new file: functions/uz.fish --- functions/uz.fish | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 functions/uz.fish (limited to 'functions/uz.fish') diff --git a/functions/uz.fish b/functions/uz.fish new file mode 100644 index 0000000..b23780f --- /dev/null +++ b/functions/uz.fish @@ -0,0 +1,26 @@ +function uz --description "Decompress an archive without making a mess" + +if test (count $argv) -lt 1 + echo "Missing argument." + return 1 +end + +if not command -sq bsdtar + echo "Can't fint bsdtar." + return 1 +end + +for archive in $argv + set -l dir (string split '.' "$archive")[1] + if not test -d "$dir" + mkdir "$dir" + pushd "$dir" + command bsdtar -xf ../"$archive" + popd + else + echo "Can't overwrite existing directory." + end +end + +end + -- cgit v1.3.1