zsh-users / antigen

The plugin manager for zsh.
http://antigen.sharats.me
MIT License
8k stars 279 forks source link

.antigen/init.zsh has wrong antigen.zsh script location #650

Open TimJones opened 6 years ago

TimJones commented 6 years ago

Description

Antigen ignores real script location when generating cache.

Steps to reproduce

  1. Install antigen latest version
    
    % curl -L https://github.com/zsh-users/antigen/releases/download/v2.2.3/antigen.zsh > ~/.antigen.zsh
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
    100   600    0   600    0     0    692      0 --:--:-- --:--:-- --:--:--   692
    100 58907  100 58907    0     0  29995      0  0:00:01  0:00:01 --:--:--  183k
    % echo "source ~/.antigen.zsh
    antigen apply" >> ~/.zshrc

% zsh # Open a new interactive shell to invoke ~/.zshrc % antigen version antigen:source:2: no such file or directory: /home/tim/antigen.zsh % grep -C2 "/home/tim/antigen.zsh" /home/tim/.antigen/init.zsh antigen () { local MATCH MBEGIN MEND [[ "$ZSH_EVAL_CONTEXT" =~ "toplevel:" || "$ZSH_EVAL_CONTEXT" =~ "cmdarg:" ]] && source "/home/tim/antigen.zsh" && eval antigen $@; return 0; }


Expected behavior:

Antigen caches the actual location of the initial script.

## Software version

- `antigen version`

Antigen v2.2.3 (ff391b5) Revision date: 2018-01-02 13:19:57 +0100

- `zsh --version`

zsh 5.1.1 (x86_64-ubuntu-linux-gnu)

- `uname -a`

Linux Desktop-01 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014 x86_64 x86_64 x86_64 GNU/Linux



## Configuration

- gist of `.antigenrc` N\A
- gist of `.zshrc` N\A

## More information

The bug seems to be here https://github.com/zsh-users/antigen/blob/develop/bin/antigen.zsh#L1833 as the location of the `antigen-zsh` script is hard-coded there during cache generation. I think it was only tested against a git-clone installation.
desyncr commented 6 years ago

Thanks for reporting this. I'll take a look!

mattrossman commented 4 years ago

2 years later, any updates? I'm unable to use the antigen command without changing my install location. I don't want antigen cluttering my home directory.