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.
This commit is contained in:
Rezart Qelibari
2022-01-23 18:15:36 +01:00
parent 069e13b863
commit 8e60af9430

View File

@@ -12,9 +12,13 @@ function cloneZSHLibRepo() {
git submodule -q update --init --recursive --remote git submodule -q update --init --recursive --remote
} }
function isDebug() {
test "${DEBUG}" -eq 1 -o "${DEBUG}" = true
}
function main() { function main() {
local tmddir="`mktemp -d -t 'macos-system'`" local tmddir="`mktemp -d -t 'macos-system'`"
trap 'rm -fr -- "${tmpdir}"' EXIT isDebug || trap 'rm -fr -- "${tmpdir}"' EXIT
pushd -q "${tmddir}" pushd -q "${tmddir}"
cloneMacOSSystemRepo cloneMacOSSystemRepo
cloneZSHLibRepo cloneZSHLibRepo