aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2019-10-16 13:54:10 +0800
committerAaron LI <aly@aaronly.me>2019-10-16 13:54:10 +0800
commit30f17b89f09b8f531a9fb61175b4c456ded3b843 (patch)
tree23d8d1cb6e80e4606674fc67bb898a0599d620bb
parent69831225acd6b3b770bb4bc8b14dfc284e382567 (diff)
downloadatoolbox-30f17b89f09b8f531a9fb61175b4c456ded3b843.tar.bz2
cli/unzip-gbk: Exit if error occurs
-rwxr-xr-xcli/unzip-gbk.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/unzip-gbk.sh b/cli/unzip-gbk.sh
index 53c7b57..37d152c 100755
--- a/cli/unzip-gbk.sh
+++ b/cli/unzip-gbk.sh
@@ -43,13 +43,13 @@ esac
zipfile=$(realpath "$1")
curdir=$(pwd)
tmpdir=$(mktemp -d)
-cd "${tmpdir}"
+cd "${tmpdir}" || exit $?
echo "Extracting archive '${zipfile}' ..."
extract "${zipfile}"
echo "Fixing filenames ..."
fixnames
-cd "${curdir}"
+cd "${curdir}" || exit $?
mv "${tmpdir}"/* .
rmdir "${tmpdir}"