summaryrefslogtreecommitdiffstats
path: root/.local/bin/ext
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2020-08-28 13:31:47 -0400
committerLuke Smith <luke@lukesmith.xyz>2020-08-28 13:31:47 -0400
commit86480f70d94cc38defa8060f9acf3e146d931740 (patch)
tree28ffb3508f4840db5de3746ebcdd6739c67e48b7 /.local/bin/ext
parentedde6779d4c6c279cd43e61bec2e9cbc9227d804 (diff)
parent0582b495937117d899ce8ef715a89c6cc25a36cf (diff)
downloadeibhear-86480f70d94cc38defa8060f9acf3e146d931740.tar.gz
eibhear-86480f70d94cc38defa8060f9acf3e146d931740.tar.zst
eibhear-86480f70d94cc38defa8060f9acf3e146d931740.zip
Merge branch 'master' of github.com:LukeSmithxyz/voidrice into master
Diffstat (limited to '.local/bin/ext')
-rwxr-xr-x.local/bin/ext8
1 files changed, 4 insertions, 4 deletions
diff --git a/.local/bin/ext b/.local/bin/ext
index c5f89c5..806ce5e 100755
--- a/.local/bin/ext
+++ b/.local/bin/ext
@@ -8,19 +8,19 @@
while getopts "hc" o; do case "${o}" in
c) extracthere="True" ;;
- *) printf "Options:\\n -c: Extract archive into current directory rather than a new one.\\n" && exit ;;
+ *) printf "Options:\\n -c: Extract archive into current directory rather than a new one.\\n" && exit 1 ;;
esac done
if [ -z "$extracthere" ]; then
archive="$(readlink -f "$*")" &&
directory="$(echo "$archive" | sed 's/\.[^\/.]*$//')" &&
mkdir -p "$directory" &&
- cd "$directory" || exit
+ cd "$directory" || exit 1
else
- archive="$(readlink -f "$(echo "$*" | cut -d' ' -f2)")"
+ archive="$(readlink -f "$(echo "$*" | cut -d' ' -f2)" 2>/dev/null)"
fi
-[ "$archive" = "" ] && printf "Give archive to extract as argument.\\n" && exit
+[ -z "$archive" ] && printf "Give archive to extract as argument.\\n" && exit 1
if [ -f "$archive" ] ; then
case "$archive" in