mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-06 00:41:15 -03:00
Use string split in export.fish
It's a bit more explicit than replace.
This commit is contained in:
@@ -4,11 +4,8 @@ function export --description 'Set global variable. Alias for set -gx, made for
|
||||
return 0
|
||||
end
|
||||
for arg in $argv
|
||||
# Only split on the first =
|
||||
# The literal "\n" is necessary because string doesn't interpret it without -r
|
||||
set -l v (echo $arg | string replace "=" \n)
|
||||
set -l c (count $v)
|
||||
switch $c
|
||||
set -l v (string split -m 1 "=" -- $arg)
|
||||
switch (count $v)
|
||||
case 1
|
||||
set -gx $v $$v
|
||||
case 2
|
||||
|
||||
Reference in New Issue
Block a user