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]
eval "set -gx $pair[1] $pair[2]"
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 < $argv[1]
end
function readenv --on-variable PWD
if test -r .env
loadenv .env
end
end
readenv
#function readenv --on-variable PWD
#if test -r .env
#loadenv .env
#end
#end
#readenv
end

View File

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