summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-11-18 06:50:57 +0200
committerLars Wirzenius <liw@liw.fi>2020-11-18 06:50:57 +0200
commita6a2d87a229e079fe5545914a46dd41afe8e80db (patch)
tree74dbaba816e030821e21e912ce94e93fdf8e5b2b /templates
parent4d587379b59a39128dfc358ade899bec9662d36f (diff)
downloadsubplot-a6a2d87a229e079fe5545914a46dd41afe8e80db.tar.gz
feat(templates/bash): set TMPDIR also for bash template
Diffstat (limited to 'templates')
-rw-r--r--templates/bash/template.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/templates/bash/template.sh b/templates/bash/template.sh
index 8e8d75a..565fa66 100644
--- a/templates/bash/template.sh
+++ b/templates/bash/template.sh
@@ -182,6 +182,7 @@ scenario_{{ loop.index }}() {
scendir="$(mktemp -d -p "$_datadir")"
cd "$scendir"
export HOME="$scendir"
+ export TMPDIR="$scendir"
ctx_new
cleanups[0]=''
@@ -244,11 +245,11 @@ envnames()
env -0 | xargs -0 -n1 -i'{}' sh -c "printf '%s\n' '{}' | head -n1 | sed 's/=.*//'"
}
-# unset all environment variables.
+# Unset all environment variables. At the beginning of each scenario,
+# some additional ones will be set to the per-scenario directory.
unset $(envnames)
export PATH=/bin:/usr/bin
export SHELL=/bin/sh
-export HOME=/ # Will be set to datadir for each scenario.
#############################################################################