From 07aa9a5d01fbaa9e9139de5a65029168e8975871 Mon Sep 17 00:00:00 2001 From: Rezart Qelibari Date: Sun, 23 Jan 2022 18:19:36 +0100 Subject: [PATCH] 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. --- bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap.sh b/bootstrap.sh index 21651da..5785c32 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -18,7 +18,7 @@ function isDebug() { function main() { local tmddir="`mktemp -d -t 'macos-system'`" - isDebug || trap 'rm -fr -- "${tmpdir}"' EXIT + isDebug || trap "rm -fr -- '${tmpdir}'" EXIT pushd -q "${tmddir}" cloneMacOSSystemRepo cloneZSHLibRepo