mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 20:33:08 +00:00
Allow export
to set colon-separated PATH
, CDPATH
and MANPATH
.
This commit is contained in:
parent
9598218a94
commit
f38646593c
1 changed files with 6 additions and 1 deletions
|
@ -9,7 +9,12 @@ function export --description 'Set global variable. Alias for set -gx, made for
|
|||
case 1
|
||||
set -gx $v $$v
|
||||
case 2
|
||||
set -gx $v[1] $v[2]
|
||||
if contains -- $v[1] PATH CDPATH MANPATH
|
||||
set -l colonized_path (string replace -- "$$v[1]" (string join ":" -- $$v[1]) $v[2])
|
||||
set -gx $v[1] (string split ":" -- $colonized_path)
|
||||
else
|
||||
set -gx $v[1] $v[2]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue