mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-27 03:14:56 +01:00
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
16 lines
507 B
Bash
16 lines
507 B
Bash
# You will probably want to list this plugin as the first in your .zshrc.
|
|
|
|
# This will look for a custom profile for the local machine and each domain or
|
|
# subdomain it belongs to. (e.g. com, example.com and foo.example.com)
|
|
parts=(${(s:.:)HOST})
|
|
for i in {${#parts}..1}; do
|
|
profile=${(j:.:)${parts[$i,${#parts}]}}
|
|
file=$ZSH_CUSTOM/profiles/$profile
|
|
if [ -d $file ]; then
|
|
for config_file ($file/*.zsh(N)); do
|
|
source $config_file
|
|
done
|
|
elif [ -f $file ]; then
|
|
source $file
|
|
fi
|
|
done
|