mirror of
https://github.com/nix-community/nix-direnv.git
synced 2025-11-08 11:36:11 +01:00
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:
parent
f988975869
commit
5a91446000
1 changed files with 3 additions and 3 deletions
6
direnvrc
6
direnvrc
|
|
@ -43,15 +43,15 @@ 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
|
||||
|
||||
log_status eval "$cache"
|
||||
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
|
||||
export PATH=$PATH:$path_backup TERM=$term_backup
|
||||
if [[ ! -z ${tmp_backup+x} ]]; then
|
||||
export TMPDIR=${tmp_backup}
|
||||
else
|
||||
unset TMPDIR
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue