fish: let plugin read vendor_* dirs which is used in nixpkgs fishPlugins

This commit is contained in:
Vonfry 2024-04-07 15:29:24 +08:00
parent c0ef0dab55
commit 94908c80b1
No known key found for this signature in database
GPG key ID: 1B81687FBA75D6B5
2 changed files with 28 additions and 0 deletions

View file

@ -523,15 +523,29 @@ in {
set -l plugin_dir ${plugin.src}
# Set paths to import plugin components
if test -d $plugin_dir/share/fish/vendor_functions.d
set fish_function_path $fish_function_path[1] $plugin_dir/share/fish/vendor_functions.d $fish_function_path[2..-1]
end
if test -d $plugin_dir/functions
set fish_function_path $fish_function_path[1] $plugin_dir/functions $fish_function_path[2..-1]
end
if test -d $plugin_dir/share/fish/vendor_completions.d
set fish_complete_path $fish_complete_path[1] $plugin_dir/share/fish/vendor_completions.d $fish_complete_path[2..-1]
end
if test -d $plugin_dir/completions
set fish_complete_path $fish_complete_path[1] $plugin_dir/completions $fish_complete_path[2..-1]
end
# Source initialization code if it exists.
if test -d $plugin_dir/share/fish/vendor_conf.d
for f in $plugin_dir/share/fish/vendor_conf.d/*.fish
source $f
end
end
if test -d $plugin_dir/conf.d
for f in $plugin_dir/conf.d/*.fish
source $f

View file

@ -11,15 +11,29 @@ let
set -l plugin_dir ${fooPluginSrc}
# Set paths to import plugin components
if test -d $plugin_dir/share/fish/vendor_functions.d
set fish_function_path $fish_function_path[1] $plugin_dir/share/fish/vendor_functions.d $fish_function_path[2..-1]
end
if test -d $plugin_dir/functions
set fish_function_path $fish_function_path[1] $plugin_dir/functions $fish_function_path[2..-1]
end
if test -d $plugin_dir/share/fish/vendor_completions.d
set fish_complete_path $fish_complete_path[1] $plugin_dir/share/fish/vendor_completions.d $fish_complete_path[2..-1]
end
if test -d $plugin_dir/completions
set fish_complete_path $fish_complete_path[1] $plugin_dir/completions $fish_complete_path[2..-1]
end
# Source initialization code if it exists.
if test -d $plugin_dir/share/fish/vendor_conf.d
for f in $plugin_dir/share/fish/vendor_conf.d/*.fish
source $f
end
end
if test -d $plugin_dir/conf.d
for f in $plugin_dir/conf.d/*.fish
source $f