[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master a8bfdf2 3/3: update_autogen: Improve error handling slightly
From: |
Stefan Kangas |
Subject: |
master a8bfdf2 3/3: update_autogen: Improve error handling slightly |
Date: |
Thu, 2 Dec 2021 12:35:07 -0500 (EST) |
branch: master
commit a8bfdf2efc41479efecee4dff71fe8a341cb5729
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>
update_autogen: Improve error handling slightly
* admin/update_autogen: Check exit status of cd. Use single
quoting for trap condition.
---
admin/update_autogen | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/admin/update_autogen b/admin/update_autogen
index 2b6a460..99297a9 100755
--- a/admin/update_autogen
+++ b/admin/update_autogen
@@ -44,7 +44,7 @@ PD=${0%/*}
[ "$PD" = "$0" ] && PD=. # if PATH includes PWD
## This should be the admin directory.
-cd $PD
+cd $PD || exit
cd ../
[ -d admin ] || die "Could not locate admin directory"
@@ -102,7 +102,7 @@ done
tempfile=/tmp/$PN.$$
-trap "rm -f $tempfile 2> /dev/null" EXIT
+trap 'rm -f $tempfile 2> /dev/null' EXIT
while getopts ":hcfqA:CL" option ; do