Skip to content

Commit f8da3dc

Browse files
authored
Merge pull request #17 from nix-community/ssl-cert
2 parents 5498c54 + ba30d7f commit f8da3dc

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

direnvrc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ use_nix() {
4747
local tmp_backup=$TMPDIR
4848
fi
4949

50-
local impure_ssl_cert_file=${SSL_CERT_FILE:-}
51-
local impure_nix_ssl_cert_file=${NIX_SSL_CERT_FILE:-}
50+
local impure_ssl_cert_file=${SSL_CERT_FILE:-__UNSET__}
51+
local impure_nix_ssl_cert_file=${NIX_SSL_CERT_FILE:-__UNSET__}
5252

5353
log_status eval "$cache"
5454
read -r cache_content < "$cache"
@@ -62,17 +62,17 @@ use_nix() {
6262

6363
# `nix-shell --pure` sets invalid ssl certificate paths
6464
if [[ "${SSL_CERT_FILE:-}" = /no-cert-file.crt ]]; then
65-
if [[ -n ${impure_ssl_cert_file+x} ]]; then
66-
export SSL_CERT_FILE=${impure_ssl_cert_file}
67-
else
65+
if [[ ${impure_ssl_cert_file} == __UNSET__ ]]; then
6866
unset SSL_CERT_FILE
67+
else
68+
export SSL_CERT_FILE=${impure_ssl_cert_file}
6969
fi
7070
fi
7171
if [[ "${NIX_SSL_CERT_FILE:-}" = /no-cert-file.crt ]]; then
72-
if [[ -n ${impure_nix_ssl_cert_file+x} ]]; then
73-
export NIX_SSL_CERT_FILE=${impure_nix_ssl_cert_file}
74-
else
72+
if [[ ${impure_nix_ssl_cert_file} == __UNSET__ ]]; then
7573
unset NIX_SSL_CERT_FILE
74+
else
75+
export NIX_SSL_CERT_FILE=${impure_nix_ssl_cert_file}
7676
fi
7777
fi
7878

0 commit comments

Comments
 (0)