Skip to content

Commit

Permalink
fix: add .gitignore with '*' pattern in a plugins ._zinit directory (#…
Browse files Browse the repository at this point in the history
…397)

Zinit creates a directory named `._zinit` to store metadata. However, this metadata should not
be added to git.

Closes #395

Signed-off-by: wzy <[email protected]>
Co-authored-by: vladislav doster <[email protected]>
  • Loading branch information
Freed-Wu and vladdoster committed Apr 8, 2023
1 parent 6845b7a commit a8a6382
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion doc/zsdoc/zinit-install.zsh.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ ____
`#compdef <names ...>'
____
Has 549 line(s). Doesn't call other functions.
Has 573 line(s). Doesn't call other functions.
Uses feature(s): _autoload_, _bindkey_, _compdef_, _compdump_, _eval_, _read_, _setopt_, _unfunction_, _zle_, _zstyle_
Expand Down
4 changes: 2 additions & 2 deletions doc/zsdoc/zinit.zsh.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,7 @@ ____
Note that some terminals do not support all combinations.
____
Has 117 line(s). Doesn't call other functions.
Has 120 line(s). Doesn't call other functions.
Called by:
Expand All @@ -1485,7 +1485,7 @@ ____
`#compdef <names ...>'
____
Has 549 line(s). Doesn't call other functions.
Has 573 line(s). Doesn't call other functions.
Uses feature(s): _autoload_, _bindkey_, _compdef_, _compdump_, _eval_, _read_, _setopt_, _unfunction_, _zle_, _zstyle_
Expand Down
4 changes: 2 additions & 2 deletions zinit-install.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || {
command rm -f "${REPLY:t}.sig"
fi

command mkdir -p ._zinit
command mkdir -p ._zinit && echo '*' > ._zinit/.gitignore
[[ -d ._zinit ]] || return 2
builtin print -r -- $url >! ._zinit/url || return 3
builtin print -r -- ${REPLY} >! ._zinit/is_release${count:#1} || return 4
Expand All @@ -404,7 +404,7 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || {
return 1
}
} elif [[ $site = cygwin ]] {
command mkdir -p "$local_path/._zinit"
command mkdir -p "$local_path/._zinit" && echo '*' > "$local_path/._zinit/.gitignore"
[[ -d "$local_path" ]] || return 1

(
Expand Down
2 changes: 1 addition & 1 deletion zinit-side.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
svn
)

command mkdir -p "$___pfx"
command mkdir -p "$___pfx" && echo '*' > "$___pfx/.gitignore"
local ___key ___var_name
# No nval_ices here
for ___key in ${ice_order[@]:#(${(~j:|:)nval_ices[@]})} ${(s: :)___add_ices[@]}; do
Expand Down

0 comments on commit a8a6382

Please sign in to comment.