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

'selfupdate' failed even antigen is installed using git clone #99

Closed
wangyandongnx opened this issue Dec 11, 2014 · 6 comments
Closed

Comments

@wangyandongnx
Copy link

»  zsh --version                                                          
zsh 5.0.5 (i686-pc-linux-gnu)
-----
» zsh --version                                                             
zsh 5.0.5 (x86_64-apple-darwin14.0)

I installed antigen using git clone. When running the antigen selfupdate command, it gives this error

Your copy of antigen doesn't appear to be a git clone. 
The 'selfupdate' command cannot work in this case.
@desyncr
Copy link
Member

desyncr commented Jan 4, 2015

The selfupdate command basically executes a git pull on $_ANTIGEN_INSTALL_DIR. What's the value of that environment variable? Check that it matches the path where you cloned antigen.

Hope that helps!

@wangyandongnx
Copy link
Author

Actually _ANTIGEN_INSTALL_DIR is not available after antigen.sh is evaluated:

wangyandong@wangyandong-osx ~
» echo $_ANTIGEN_INSTALL_DIR                                                                                        1 ↵

wangyandong@wangyandong-osx ~
»

» cd $_ANTIGEN_INSTALL_DIR will navigate to the home directory.

@desyncr
Copy link
Member

desyncr commented Jan 4, 2015

Of course, as $_ANTIGEN_INSTALL_DIR is a local variable on the antigen command. Thought you could debug antigen.zsh and check there the value of this variable.

@wangyandongnx
Copy link
Author

Thanks for your reply.

I add the debug line within the antigen-selfupdate function itself

antigen-selfupdate () {
    echo "==> $_ANTIGEN_INSTALL_DIR"
    ( cd $_ANTIGEN_INSTALL_DIR
        if [[ ! ( -d .git || -f .git ) ]]; then
            echo "Your copy of antigen doesn't appear to be a git clone. " \
                "The 'selfupdate' command cannot work in this case."
            return 1
        fi
...

and it still gives the same error

wangyandong@wangyandong-osx ~
» antigen selfupdate                                                                                                1 ↵
==>
Your copy of antigen doesn't appear to be a git clone.  The 'selfupdate' command cannot work in this case.

@desyncr
Copy link
Member

desyncr commented Jan 4, 2015

It looks as if $_ANTIGEN_INSTALL_DIR was empty. Do this: Add the following lines to antigen.zsh:

echo $0
echo $(dirname "$0")

After this line. In my set up it prints:

/home/<username>/.antigen//antigen.zsh
/home/<username>/.antigen

Are you using tmux? It some times messes up with env variables.

@wangyandongnx
Copy link
Author

I'm not using tmux now.

echo $0
echo $(dirname "$0")

gives expected results

/Users/wangyandong/.antigen/antigen.zsh
/Users/wangyandong/.antigen

I think I've found the problem. antigen.sh is sourced within a function I defined in my dotfiles. After moving the source /<path_to_antigen>/antigen.sh line out of the function, it works fine now.

Thank you.

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

2 participants