fix: auto-loading .env is not ideal

This commit is contained in:
Klesh Wong 2022-02-21 09:12:37 +08:00
parent e7bc71f448
commit 62829ef995
2 changed files with 10 additions and 8 deletions

View File

@ -92,16 +92,19 @@ if status is-interactive
if string match -q "'*" $pair[2]; or string match -q '"*' $pair[2] if string match -q "'*" $pair[2]; or string match -q '"*' $pair[2]
eval "set -gx $pair[1] $pair[2]" eval "set -gx $pair[1] $pair[2]"
else else
eval "set -gx $pair[1] \"$pair[2]\"" if not eval "export $pair[1]=\"$pair[2]\""
echo failed to export pair $pair
return
end
end end
end < $argv[1] end < $argv[1]
end end
function readenv --on-variable PWD #function readenv --on-variable PWD
if test -r .env #if test -r .env
loadenv .env #loadenv .env
end #end
end #end
readenv #readenv
end end

View File

@ -8,7 +8,6 @@
}, },
"coc.preferences.formatOnSaveFiletypes": [ "coc.preferences.formatOnSaveFiletypes": [
"rust", "rust",
"json",
"go" "go"
] ]
} }