From 08beed085328ec64a0f4bfed4f6c3b0800673b54 Mon Sep 17 00:00:00 2001 From: Abhishek Mukherjee Date: Wed, 14 Oct 2015 17:50:56 -0700 Subject: [PATCH] Add support in profiles plugin for directories The profiles plugin currently has support to load a single "profile" file for each component in the FQDN. This changeset makes it so the plugin supports the filename actually being a directory with multiple *.zsh files in it. Each of those files are then loaded in alphabetical order --- plugins/profiles/profiles.plugin.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/profiles/profiles.plugin.zsh b/plugins/profiles/profiles.plugin.zsh index 5bc56cea0..8576eb1c7 100644 --- a/plugins/profiles/profiles.plugin.zsh +++ b/plugins/profiles/profiles.plugin.zsh @@ -6,7 +6,11 @@ parts=(${(s:.:)HOST}) for i in {${#parts}..1}; do profile=${(j:.:)${parts[$i,${#parts}]}} file=$ZSH_CUSTOM/profiles/$profile - if [ -f $file ]; then + if [ -d $file ]; then + for config_file ($file/*.zsh(N)); do + source $config_file + done + elif [ -f $file ]; then source $file fi done