Skip to content

Commit

Permalink
Merge pull request #42 from ColinNg/master
Browse files Browse the repository at this point in the history
Fix zsh sourcing detection
  • Loading branch information
doekman authored Jan 8, 2025
2 parents 0427d9a + 70cb596 commit ffb366c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ok.sh
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,9 @@ environment variables (for internal use):
}

is_sourced=""
if [ "${ZSH_ARGZERO:+IS_SET}" = "IS_SET" ]; then
if [ "$ZSH_ARGZERO" = "zsh" ]; then
if [ -n "$ZSH_VERSION" ]; then
# For zsh, check if script name matches $0
if [[ "${(%):-%N}" == *"ok.sh" ]]; then
is_sourced="yes_indeed"
fi
else
Expand Down

0 comments on commit ffb366c

Please sign in to comment.