Fix TMPDIR backup

This was clearing TMPDIR since it was first not setting the
`tmp_backup` local variable, and then, since `tmp_backup` was null, it
was unsetting TMPDIR.
This commit is contained in:
Anthony Cowley 2020-03-04 22:13:58 -05:00
parent f988975869
commit ac5dcea478

View file

@ -43,7 +43,7 @@ use_nix() {
log_status using cached derivation
fi
local term_backup=$TERM path_backup=$PATH
if [[ -z ${TMPDIR+x} ]]; then
if [[ ! -z ${TMPDIR+x} ]]; then
local tmp_backup=$TMPDIR
fi
@ -51,7 +51,7 @@ use_nix() {
read -r cache_content < "$cache"
eval "$cache_content"
export PATH=$PATH:$path_backup TERM=$term_backup TMPDIR=$tmp_backup
if [ -z ${tmp_backup+x} ]; then
if [ ! -z ${tmp_backup+x} ]; then
export TMPDIR=${tmp_backup}
else
unset TMPDIR