aboutsummaryrefslogtreecommitdiff
path: root/mingling_cli/scripts/load_mling.fish
blob: ea8f1fffc1403b14188001e3aace5000494bb142 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env fish

set -g MLING_SCRIPT_DIR (path dirname (path resolve (status --current-filename)))

if not contains -- "$MLING_SCRIPT_DIR/bin" $PATH
    set -gx PATH "$MLING_SCRIPT_DIR/bin" $PATH
end

if test -f "$MLING_SCRIPT_DIR/scripts/mling_comp.fish"
    source "$MLING_SCRIPT_DIR/scripts/mling_comp.fish"
end

for pkg_dir in (mingling-cli __loadpkgs_path 2>/dev/null | string split '\n' | string match -rv '^$')
    if test -d "$pkg_dir"; and not contains -- "$pkg_dir" $PATH
        set -gx PATH "$pkg_dir" $PATH
    end
end

for script in (mingling-cli __loadpkgs_comp_scripts 2>/dev/null | string split '\n' | string match -rv '^$')
    if string match -q '*.fish' -- "$script"; and test -f "$script"
        source "$script"
    end
end