mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-27 16:51:15 -03:00
Allow export to set colon-separated PATH, CDPATH and MANPATH.
This commit is contained in:
committed by
Fabian Homborg
parent
9598218a94
commit
f38646593c
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user