jotyGill / ezsh

quickly install zsh, oh-my-zsh with power-level-9k zsh-completions zsh-autosuggestions zsh-syntax-highlighting history-substring-search
221 stars 74 forks source link

Personal config file search fails because of invalid search #35

Open ajhenry opened 1 week ago

ajhenry commented 1 week ago

When trying to load up the personal configs from .zshrc, one of the search patterns fails to find any matches so it exits with a 1 causing the rest of the loop to exit without sourcing the configs

It outputs the following error even when files exist

if [ "$(ls -A $ZSH_CONFIGS_DIR)" ]; then
    for file in "$ZSH_CONFIGS_DIR"/* "$ZSH_CONFIGS_DIR"/.*; do
        # Exclude '.' and '..' from being sourced
        if [ -f "$file" ]; then
            source "$file"
        fi
    done
fi
zsh: no matches found: /Users/ajhenry/.config/ezsh/zshrc/.*
ls /Users/ajhenry/.config/ezsh/zshrc
personal.zsh 
work.zsh

Changing the search to remove the second search fixes the issue

if [ "$(ls -A $ZSH_CONFIGS_DIR)" ]; then
    for file in "$ZSH_CONFIGS_DIR"/*; do
        # Exclude '.' and '..' from being sourced
        if [ -f "$file" ]; then
            source "$file"
        fi
    done
fi