Use local variable value for trap at parse time

`trap` can not access the value of a variable defined as local once the
function body is left. So we use the value of the variable at parse time
instead of trying to access the value at runtime of the `trap` command.
This commit is contained in:
Rezart Qelibari
2022-01-23 18:19:36 +01:00
parent 8e60af9430
commit 07aa9a5d01

View File

@@ -18,7 +18,7 @@ function isDebug() {
function main() { function main() {
local tmddir="`mktemp -d -t 'macos-system'`" local tmddir="`mktemp -d -t 'macos-system'`"
isDebug || trap 'rm -fr -- "${tmpdir}"' EXIT isDebug || trap "rm -fr -- '${tmpdir}'" EXIT
pushd -q "${tmddir}" pushd -q "${tmddir}"
cloneMacOSSystemRepo cloneMacOSSystemRepo
cloneZSHLibRepo cloneZSHLibRepo