mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2024-11-23 20:00:00 +08:00
8aa6bf7ee2
This was actually trying to load PATHs that do not exist under $OMF_CONFIG directory and sourcing files that did not exist.
22 lines
561 B
Fish
22 lines
561 B
Fish
# SYNOPSIS
|
|
# autoload <path [path...]>
|
|
#
|
|
# OVERVIEW
|
|
# Autoload a function or completion path. Add the specified list of
|
|
# directories to $fish_function_path. Any `completions` directories
|
|
# are correctly added to the $fish_complete_path.
|
|
|
|
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
|
|
set dest fish_complete_path
|
|
end
|
|
|
|
contains "$path" $$dest; or set $dest "$path" $$dest
|
|
end
|
|
end
|
|
end
|