zgen icon indicating copy to clipboard operation
zgen copied to clipboard

zgen-update fails after latest update

Open jnunderwood opened this issue 6 years ago • 3 comments

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

jnunderwood avatar Nov 12 '18 23:11 jnunderwood

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 avatar Nov 22 '18 15:11 sukramblak

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 <[email protected]>
 Date:   Sat Oct 20 11:10:56 2018 +0200
 
     Enable extended_glob in zgen-update
     
     The (^.git)/* glob will fail without it.

sukramblak avatar Nov 22 '18 15:11 sukramblak

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.

zalberico avatar Jul 20 '21 04:07 zalberico