mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-10 23:24:39 +00:00
Use string split in export.fish
It's a bit more explicit than replace.
This commit is contained in:
parent
b6e058985b
commit
52f8707c3e
1 changed files with 2 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue