mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-02-21 06:18:24 +08:00
Remove unnecessary code
This was actually trying to load PATHs that do not exist under $OMF_CONFIG directory and sourcing files that did not exist.
This commit is contained in:
parent
8aa60c55ae
commit
8aa6bf7ee2
12
init.fish
12
init.fish
@ -31,17 +31,11 @@ set -q OSTYPE; or set -g OSTYPE (uname)
|
||||
set -l user_function_path $fish_function_path[1]
|
||||
set fish_function_path[1] $OMF_PATH/lib
|
||||
|
||||
set -l theme {$OMF_PATH,$OMF_CONFIG}/themes/(cat $OMF_CONFIG/theme)
|
||||
set -l paths $OMF_PATH/pkg/*
|
||||
set -l config $OMF_CONFIG/pkg/*
|
||||
set -l ignore $OMF_IGNORE
|
||||
set -l theme {$OMF_PATH,$OMF_CONFIG}/themes/(cat $OMF_CONFIG/theme)
|
||||
|
||||
for path in $paths
|
||||
set config $OMF_CONFIG/(basename $path) $config
|
||||
end
|
||||
for path in $OMF_PATH/lib $OMF_PATH/lib/git {$OMF_PATH,$OMF_CONFIG}/pkg/* $theme
|
||||
contains -- (basename $path) $OMF_IGNORE; and continue
|
||||
|
||||
for path in $OMF_PATH/lib $OMF_PATH/lib/git $paths $theme $config
|
||||
contains -- (basename $path) $ignore; and continue
|
||||
autoload $path $path/completions
|
||||
source $path/(basename $path).fish ^/dev/null
|
||||
and emit init_(basename $path) $path
|
||||
|
@ -10,9 +10,11 @@ function autoload -d "autoload a function or completion path"
|
||||
for path in $argv
|
||||
if test -d "$path"
|
||||
set -l dest fish_function_path
|
||||
if test (basename "$path") = "completions"
|
||||
|
||||
if test (basename "$path") = completions
|
||||
set dest fish_complete_path
|
||||
end
|
||||
|
||||
contains "$path" $$dest; or set $dest "$path" $$dest
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user