tarjoilija / zgen

A lightweight and simple plugin manager for ZSH
BSD 2-Clause "Simplified" License
1.5k stars 99 forks source link

zgen-update fails after latest update #110

Open jnunderwood opened 5 years ago

jnunderwood commented 5 years ago

After the latest update, zgen-update fails with this error message:

-- zgen: Updating '/home/junderwo/.zgen/(^.git)/*' ...
zgen-update:cd:3: no such file or directory: /home/junderwo/.zgen/(^.git)/*
-- zgen: Deleting `/home/junderwo/.zgen/init.zsh` ...

I think it may be in function zgen-update(), on line 218 of zgen.zsh, in commit 5999d9e from pull request #95 that caused this.

Old code that works:

    for repo in "${ZGEN_DIR}"/*/*; do

New code that may be broken:

    for repo in "${ZGEN_DIR}"/(^.git)/*; do
sukramblak commented 5 years ago

I can confirm this problem.

I'm a bit puzzled what the (^.git) is meant to do?

^.git would mean match anything but .git but what are the () for ? In addition in my install there is not $HOME/.zgen/.git directory.

After using the following function manually i got a lot of updates but the "no match found" is still there!

zgen-update-old () {
    for repo in "${ZGEN_DIR}"/*/*
    do
    -zgpute "Updating '${repo}' ..."
    (
        cd "${repo}" && git pull && git submodule update --init --recursive
    )
    done
                               zgen-reset
}
sukramblak commented 5 years ago

Hi

i figured it out myself after running zgen selfupdate it pulled updates for zgen and worked again. This is explained in the commit msg.

 commit f0034837e3044192991213ee708c67dfa6182f8f
 Author: David Pärsson <david@parsson.se>
 Date:   Sat Oct 20 11:10:56 2018 +0200

     Enable extended_glob in zgen-update

     The (^.git)/* glob will fail without it.
zalberico commented 3 years ago

If you're landing here confused - it's possible that your shell is in bash instead of zsh which will give you the same error.

If that's the case when you launch the terminal macOS should give you the command to switch the shell to zsh and then things should work.