From fccb5080ab4b1df83f01906082eea444f218776f Mon Sep 17 00:00:00 2001 From: wzy <32936898+Freed-Wu@users.noreply.github.com> Date: Sat, 8 Apr 2023 18:01:35 +0800 Subject: [PATCH] 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 <32936898+Freed-Wu@users.noreply.github.com> Co-authored-by: Vladislav Doster --- doc/zsdoc/zinit-install.zsh.adoc | 2 +- doc/zsdoc/zinit.zsh.adoc | 4 ++-- zinit-install.zsh | 4 ++-- zinit-side.zsh | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/zsdoc/zinit-install.zsh.adoc b/doc/zsdoc/zinit-install.zsh.adoc index 663779b66..a98b69d77 100644 --- a/doc/zsdoc/zinit-install.zsh.adoc +++ b/doc/zsdoc/zinit-install.zsh.adoc @@ -800,7 +800,7 @@ ____ `#compdef ' ____ -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_ diff --git a/doc/zsdoc/zinit.zsh.adoc b/doc/zsdoc/zinit.zsh.adoc index a4d5fa2cf..587710743 100644 --- a/doc/zsdoc/zinit.zsh.adoc +++ b/doc/zsdoc/zinit.zsh.adoc @@ -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: @@ -1485,7 +1485,7 @@ ____ `#compdef ' ____ -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_ diff --git a/zinit-install.zsh b/zinit-install.zsh index 55229d39b..42f628b23 100644 --- a/zinit-install.zsh +++ b/zinit-install.zsh @@ -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 @@ -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 ( diff --git a/zinit-side.zsh b/zinit-side.zsh index 7d47c189b..8c542a8d0 100644 --- a/zinit-side.zsh +++ b/zinit-side.zsh @@ -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