From 8065db422535ffc6172caa64c47a0321fd2dad8d Mon Sep 17 00:00:00 2001 From: Jorge Bucaran Date: Thu, 17 Mar 2016 16:47:30 +0900 Subject: [PATCH] Support .load files using custom scripts. --- functions/__fisher_plugin_walk.fish | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/functions/__fisher_plugin_walk.fish b/functions/__fisher_plugin_walk.fish index 7828a5c..c3d2807 100644 --- a/functions/__fisher_plugin_walk.fish +++ b/functions/__fisher_plugin_walk.fish @@ -21,7 +21,6 @@ function __fisher_plugin_walk -a plugin path switch "$base" case \*$plugin\* case \* - debug "Move %s to %s" $plugin $plugin.$base set base $plugin.$base end @@ -39,11 +38,18 @@ function __fisher_plugin_walk -a plugin path end for file in $path/{functions/,}*.{py,rb,php,pl,awk,sed} - set -l base (basename $file) + set -l prefix functions + set -l load_files (find $path -depth 1 -type f -name "*.load" ^ /dev/null) - debug "Script %s" $file + if test ! -z "$load_files" + set prefix conf.d + end - printf "%s %s %s\n" -- $file functions/$base + set -l target $prefix/(basename $file) + + debug "Script %s" $target + + printf "%s %s %s\n" -- $file $target end for n in (seq 9)