fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
6c267e88a
master
1# localization: tier1 2# Adapt construct_path from the macOS /usr/libexec/path_helper 3# executable for fish; see 4# https://opensource.apple.com/source/shell_cmds/shell_cmds-203/path_helper/path_helper.c.auto.html . 5function __fish_macos_set_env -d"set an environment variable like path_helper does (macOS only)" 6set -l result 7 8# Populate path according to config files 9for path_filein $argv [ 2 ] $argv [ 3 ] /* 10for entryin ( string split :< ?$path_file ) 11if not contains --$entry $result 12test -n " $entry " 13and set -a result$entry 14end 15end 16end 17 18# Merge in any existing path elements 19for existing_entryin $$argv [ 1 ] 20if test -n $existing_entry ;and not contains --$existing_entry $result 21set -a result$existing_entry 22end 23end 24if test $argv [ 1 ] = MANPATH 25set -a result"" 26end 27 28set -xg$argv [ 1 ] $result 29end