dotfiles

config files for my linux setup
git clone git://edryd.org/dotfiles
Log | Files | Refs | README

commit 7932af880adec72cb6536157d41c81ef6e5c8150
parent 1be0c70f925e5c0f8e6674f363079d81a8e81838
Author: Ed van Bruggen <ed@edryd.org>
Date:   Mon, 24 Mar 2025 23:54:52 -0400

uz: Improve error handling

Diffstat:
Mbin/uz | 9++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/bin/uz b/bin/uz @@ -1,5 +1,9 @@ #!/usr/bin/env bash +# uz: safe unzip +# +# unzip file into its own directory + if [[ $# != 1 ]]; then echo "usage: uz ZIPFILE" exit 1 @@ -8,6 +12,5 @@ fi # TODO don't create new directory if zip already contains one mkdir "${1%.zip}" mv "$1" "${1%.zip}" -cd "${1%.zip}" -unzip "$1" -rm -f "$1" +cd "${1%.zip}" || exit +unzip "$1" && rm -f "$1"