Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Personal config file search fails because of invalid search #35

Open
ajhenry opened this issue Jun 26, 2024 · 0 comments
Open

Personal config file search fails because of invalid search #35

ajhenry opened this issue Jun 26, 2024 · 0 comments

Comments

@ajhenry
Copy link

ajhenry commented Jun 26, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant