-
Notifications
You must be signed in to change notification settings - Fork 283
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
Fix #650 (second try) #716
base: develop
Are you sure you want to change the base?
Fix #650 (second try) #716
Conversation
@@ -46,7 +46,7 @@ cat > $ANTIGEN_CACHE <<EOC | |||
$(functions -- _antigen) | |||
antigen () { | |||
local MATCH MBEGIN MEND | |||
[[ "\$ZSH_EVAL_CONTEXT" =~ "toplevel:*" || "\$ZSH_EVAL_CONTEXT" =~ "cmdarg:*" ]] && source "$_ANTIGEN_INSTALL_DIR/antigen.zsh" && eval antigen \$@; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be source "$_ANTIGEN_INSTALL_DIR/$_ANTIGEN_INSTALL_FILENAME" ...
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is correct, ${0:A}
will resolve to /home/$USER/antigen.zsh
for ex.
I wrote up an identical fix before realizing there was already an open PR for this. Can the above be merged? Tested on Ubuntu 24.04: Renamed
antigen () {
local MATCH MBEGIN MEND
[[ "$ZSH_EVAL_CONTEXT" =~ "toplevel:*" || "$ZSH_EVAL_CONTEXT" =~ "cmdarg:*" ]] && source "/home/xxxxxxx/someothername.zsh" && eval antigen $@;
return 0;
} |
@@ -46,7 +46,7 @@ cat > $ANTIGEN_CACHE <<EOC | |||
$(functions -- _antigen) | |||
antigen () { | |||
local MATCH MBEGIN MEND | |||
[[ "\$ZSH_EVAL_CONTEXT" =~ "toplevel:*" || "\$ZSH_EVAL_CONTEXT" =~ "cmdarg:*" ]] && source "$_ANTIGEN_INSTALL_DIR/antigen.zsh" && eval antigen \$@; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is correct, ${0:A}
will resolve to /home/$USER/antigen.zsh
for ex.
This is a second try to fix the long standing bug reported in #650 in January 2018.
The first attempt was made in PR #656, but was abandoned and never merged.
In a nutshell, this bug doesn't allow the installed script to be called anything different than
antigen.zsh
, this is specially problematic if one wants to make antigen a hidden file. The proposed solution makes the name of the file dynamic.