File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,12 @@ eval set -- "$OPTS"
2121
2222trap " exit 1" INT
2323
24+ cleanup ()
25+ {
26+ rmdir " $TMPDIR "
27+ exit " $1 "
28+ }
29+
2430usage ()
2531{
2632 cat << EOF
@@ -48,8 +54,7 @@ DIRECTORY should point ‘reflac’ to somewhere that contains *.flac
4854files. Optionally terminate the argument list with -- so that any
4955possible directory names don’t get misinterpreted as arguments.
5056EOF
51- rmdir " $TMPDIR "
52- exit 0
57+ cleanup 0
5358}
5459
5560recompress ()
@@ -130,10 +135,9 @@ while true ; do
130135 shift ;;
131136 -V|--version)
132137 echo " reflac version $VERSION "
133- rmdir " $TMPDIR "
134- exit 0 ;;
138+ cleanup 0 ;;
135139 --) shift ; break ;;
136- * ) echo " $0 : This should never happen!" >&2 ; exit 1 ;;
140+ * ) echo " $0 : This should never happen!" >&2 ; cleanup 1 ;;
137141 esac
138142done
139143
@@ -142,8 +146,7 @@ if [ -z "$*" ]; then
142146fi
143147
144148if [ $VERBOSE -eq 0 ] && [ $NOACTION -eq 1 ]; then
145- rmdir " $TMPDIR "
146- exit 0
149+ cleanup 0
147150fi
148151
149152for dir; do
@@ -170,7 +173,7 @@ for dir; do
170173 -execdir " $SELF " -" $REFLAC_OPTS " {} \;
171174 fi
172175 else
173- pushd -- " $dir " > /dev/null
176+ pushd -- " $dir " > /dev/null || cleanup $?
174177 if [ $VERBOSE -gt 0 ]; then readlink -f . ; fi
175178 if [ ! -z " $( ls -- * .flac 2> /dev/null) " ]; then
176179 recompress
You can’t perform that action at this time.
0 commit comments