mirror of
https://github.com/nix-community/nix-direnv.git
synced 2025-11-09 12:06:10 +01:00
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:
parent
f988975869
commit
ac5dcea478
1 changed files with 2 additions and 2 deletions
4
direnvrc
4
direnvrc
|
|
@ -43,7 +43,7 @@ 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
|
||||||
|
|
||||||
|
|
@ -51,7 +51,7 @@ use_nix() {
|
||||||
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 TMPDIR=$tmp_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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue