From 8e60af94303b8d76f9ceda7770ee0a7867c092ea Mon Sep 17 00:00:00 2001 From: Rezart Qelibari Date: Sun, 23 Jan 2022 18:15:36 +0100 Subject: [PATCH] Do not delete temporary dir if DEBUG is set To inspect the state of the application it is useful to checkout the directory content of the temporary working directory. Setting the DEBUG variable to either 1 or true stops bootstrap.sh to delete that directory, which it does regardless if the app finished successfully or because of an error. --- bootstrap.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bootstrap.sh b/bootstrap.sh index c61a922..21651da 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -12,9 +12,13 @@ function cloneZSHLibRepo() { git submodule -q update --init --recursive --remote } +function isDebug() { + test "${DEBUG}" -eq 1 -o "${DEBUG}" = true +} + function main() { local tmddir="`mktemp -d -t 'macos-system'`" - trap 'rm -fr -- "${tmpdir}"' EXIT + isDebug || trap 'rm -fr -- "${tmpdir}"' EXIT pushd -q "${tmddir}" cloneMacOSSystemRepo cloneZSHLibRepo