mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-03 06:41:14 -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
|
case 1
|
||||||
set -gx $v $$v
|
set -gx $v $$v
|
||||||
case 2
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user