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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user