From 8fde904564c1d4d708ecb545b222b144e287b8e9 Mon Sep 17 00:00:00 2001 From: Jorge Bucaran Date: Fri, 15 Jan 2021 00:34:57 +0900 Subject: [PATCH] Simplify install/update regexes --- fisher.fish | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fisher.fish b/fisher.fish index 6fba9c5..68c3938 100644 --- a/fisher.fish +++ b/fisher.fish @@ -156,10 +156,10 @@ function fisher -a cmd -d "Fish plugin manager" contains -- $plugin $install_plugins && set --local event install || set --local event update echo -es "Installing \x1b[1m$plugin\x1b[22m" \n" "$$plugin_files_var - for file in (string match --entire --regex -- "[functions/|conf\.d/].*fish\$" $$plugin_files_var) + for file in (string match --regex --invert -- '.+/completions/.+\.fish$' $$plugin_files_var) source $file - if string match --quiet --regex -- "conf\.d/" $file - emit (string replace --all --regex -- '^.*/|\.fish$' "" $file)_$event + if set --local name (string replace --regex -- '.+conf\.d/(.+)\.fish$' '$1' $file) + emit {$name}_$event end end end