From d9b2168480207200d3538d0a3db10187b00508c3 Mon Sep 17 00:00:00 2001 From: Deposite Pirate Date: Mon, 16 Feb 2026 10:15:05 +0100 Subject: Fix funclnk modified: functions/funclnk.fish --- functions/funclnk.fish | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'functions/funclnk.fish') diff --git a/functions/funclnk.fish b/functions/funclnk.fish index 10eadb0..f3faa69 100644 --- a/functions/funclnk.fish +++ b/functions/funclnk.fish @@ -1,23 +1,24 @@ function funclnk --description "Synchronise fish script symlinks" -function _link_fish_scripts -a scriptpath +function _link_fish_scripts -a fishscriptdir if test (count $argv) -lt 1 return 1 end - set -f configdir "$HOME/Config" - set -f fishfuncdir "$__fish_config_dir/functions" + set -f cfgdir "$HOME/Config" + set -f scriptdir "$__fish_config_dir/$fishscriptdir/" + set -f relscriptdir (string replace "$HOME" '' "$scriptdir") - for script in (find $configdir -type f -path $scriptpath -name "*.fish") + for script in (find $cfgdir -type f -path "*$relscriptdir*" -name "*.fish") set -l basescriptname (path basename $script) - if test -e "$fishfuncdir/$basescriptname" + if test -e "$scriptdir/$basescriptname" continue end if ask "Add a symlink to $basescriptname to fish profile?" - pushd $fishfuncdir + pushd $scriptdir ln -s (realpath --relative-to=. $script) popd end @@ -26,8 +27,8 @@ function _link_fish_scripts -a scriptpath return 0 end -_link_fish_scripts '*/.config/fish/conf.d/*' -_link_fish_scripts '*/.config/fish/functions/*' +_link_fish_scripts 'conf.d' +_link_fish_scripts 'functions' functions -e _link_fish_scripts -- cgit v1.3.1