fix: loadenv unable to handle quote

This commit is contained in:
Klesh Wong 2022-01-28 23:34:37 +08:00
parent 02ae779966
commit e7bc71f448

View File

@ -89,7 +89,11 @@ if status is-interactive
continue
end
set pair (string split -m 1 '=' -- $line)
eval "set -gx $pair[1] \"$pair[2]\""
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]\""
end
end < $argv[1]
end