From 7656c1f3a312de573567ec6bd7372d3f260d0df9 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Mon, 30 Mar 2015 12:36:36 +0200 Subject: [zshrc] Recursive load : updates++ --- zshrc | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/zshrc b/zshrc index f17cb5c..fbb727d 100644 --- a/zshrc +++ b/zshrc @@ -68,20 +68,8 @@ if [ -d $ZDOTDIR ]; then do if test -d $root/$f then - subscript=$root/$f/$script - if test -f $subscript - then - __debug -n "${${subscript:h}##$ZDOTDIR\/}/$script... "; - echo source $subscript - __debug - fi - if test -f $subscript.gpg - then - __debug -n "${${subscript:h}##$ZDOTDIR\/}/$script [CRYPTED]... "; - echo eval \$(gpg --quiet --decrypt $subscript.gpg) - __debug - fi - + local sub=$root/$f/$script + test -f $sub && echo $sub recurse_load $script $root/$f fi done @@ -94,7 +82,21 @@ if [ -d $ZDOTDIR ]; then source $script __debug - eval $(recurse_load ${${script:t}/??_/} ${script:h}) + for f in $(recurse_load ${${script:t}/??_/}) + do + case ${f:e} in + gpg) + __debug -n "${f#$ZDOTDIR/} [CRYPTED]... " + eval $(gpg --quiet --decrypt $f.gpg) + __debug + ;; + *) + __debug -n "${f#$ZDOTDIR/}... " + source $f + __debug + ;; + esac + done done fi -- cgit v1.2.3