Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions antigen.zsh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
_ANTIGEN_INSTALL_DIR=${0:A:h}
_ANTIGEN_INSTALL_FILENAME=${0:A}
source $_ANTIGEN_INSTALL_DIR/bin/antigen.zsh
3 changes: 2 additions & 1 deletion bin/antigen.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ if [[ $ANTIGEN_CACHE != false ]]; then
fi
fi
[[ -z "$_ANTIGEN_INSTALL_DIR" ]] && _ANTIGEN_INSTALL_DIR=${0:A:h}
[[ -z "$_ANTIGEN_INSTALL_FILENAME" ]] && _ANTIGEN_INSTALL_FILENAME=${0:A}

# Each line in this string has the following entries separated by a space
# character.
Expand Down Expand Up @@ -1830,7 +1831,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 \$@;
[[ "\$ZSH_EVAL_CONTEXT" =~ "toplevel:*" || "\$ZSH_EVAL_CONTEXT" =~ "cmdarg:*" ]] && source "$_ANTIGEN_INSTALL_FILENAME" && eval antigen \$@;
return 0;
}
typeset -gaU fpath path
Expand Down
1 change: 1 addition & 0 deletions src/antigen.zsh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[[ -z "$_ANTIGEN_INSTALL_DIR" ]] && _ANTIGEN_INSTALL_DIR=${0:A:h}
[[ -z "$_ANTIGEN_INSTALL_FILENAME" ]] && _ANTIGEN_INSTALL_FILENAME=${0:A}

# Each line in this string has the following entries separated by a space
# character.
Expand Down
2 changes: 1 addition & 1 deletion src/ext/cache.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \$@;
Copy link

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" ... ?

Copy link

@simonmarty simonmarty Nov 21, 2024

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.

[[ "\$ZSH_EVAL_CONTEXT" =~ "toplevel:*" || "\$ZSH_EVAL_CONTEXT" =~ "cmdarg:*" ]] && source "$_ANTIGEN_INSTALL_FILENAME" && eval antigen \$@;
return 0;
}
typeset -gaU fpath path
Expand Down