aboutsummaryrefslogtreecommitdiff
path: root/functions/funclnk.fish
blob: 2e83b1bcfdcd396f0860ca35be3bbde0a2d22335 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function funclnk --description "Synchronise fish functions symlinks"

set configdir "$HOME/Config"
set fishfuncdir "$__fish_config_dir/functions"

for script in (find $configdir -type f -path "*/.config/fish/functions/*" -name "*.fish")
  set -l basescriptname (path basename $script)

  if test -e "$fishfuncdir/$basescriptname"
    continue
  end

  if ask "Add a symlink to $basescriptname to fish profile?"
    pushd $fishfuncdir
      ln -s (realpath --relative-to=. $script)
    popd
  end
end

end