Fix TMPDIR backup (#1)

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.

Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
This commit is contained in:
Jörg Thalheim 2020-03-05 07:33:06 +00:00 committed by GitHub
parent f988975869
commit 5a91446000
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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