Skip to content

Commit fccb508

Browse files
Freed-Wuvladdoster
andcommitted
fix: add .gitignore with '*' pattern in a plugins ._zinit/ directory (#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]>
1 parent 6845b7a commit fccb508

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

doc/zsdoc/zinit-install.zsh.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ ____
800800
`#compdef <names ...>'
801801
____
802802
803-
Has 549 line(s). Doesn't call other functions.
803+
Has 573 line(s). Doesn't call other functions.
804804
805805
Uses feature(s): _autoload_, _bindkey_, _compdef_, _compdump_, _eval_, _read_, _setopt_, _unfunction_, _zle_, _zstyle_
806806

doc/zsdoc/zinit.zsh.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,7 @@ ____
14621462
Note that some terminals do not support all combinations.
14631463
____
14641464
1465-
Has 117 line(s). Doesn't call other functions.
1465+
Has 120 line(s). Doesn't call other functions.
14661466
14671467
Called by:
14681468
@@ -1485,7 +1485,7 @@ ____
14851485
`#compdef <names ...>'
14861486
____
14871487
1488-
Has 549 line(s). Doesn't call other functions.
1488+
Has 573 line(s). Doesn't call other functions.
14891489
14901490
Uses feature(s): _autoload_, _bindkey_, _compdef_, _compdump_, _eval_, _read_, _setopt_, _unfunction_, _zle_, _zstyle_
14911491

zinit-install.zsh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || {
393393
command rm -f "${REPLY:t}.sig"
394394
fi
395395

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

410410
(

zinit-side.zsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@
330330
svn
331331
)
332332

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

0 commit comments

Comments
 (0)