Skip to content

Commit dc83b5d

Browse files
feat: ignore list
1 parent d7368cb commit dc83b5d

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,11 @@ To speed up updates by setting maximum number of parallel downloads, add this to
5454
# Parallel downloads will not be enabled if value is out-of-range
5555
ZSH_CUSTOM_AUTOUPDATE_NUM_WORKERS=8
5656
```
57+
58+
### Ignore Plugin List
59+
60+
To prevent some plugins from update, add this to your `~/.zshrc` file:
61+
```shell
62+
# support ',' ';' ';' as the split char
63+
ZSH_CUSTOM_AUTOUPDATE_IGNORE="zsh-autosuggestions, autoupdate; zsh-autosuggestions"
64+
```

autoupdate.plugin.zsh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@ function _upgrade_custom_plugin() {
5151
pt=$(dirname "$p")
5252
pt=$(basename ${pt:0:((${#pt} - 1))})
5353

54+
# Check if plugin should be ignored
55+
if [[ -n "$ZSH_CUSTOM_AUTOUPDATE_IGNORE" ]]; then
56+
echo "$ZSH_CUSTOM_AUTOUPDATE_IGNORE" | tr ',;: ' '\n' | grep -v '^$' | while read ignored; do
57+
if [[ "$pn" == "$ignored" ]]; then
58+
printf "${BLUE}%s${NORMAL}\n" "Skipping $pn $pt (in ignore list)"
59+
return 0
60+
fi
61+
done
62+
fi
63+
5464
last_head=$( git -C "${p}" rev-parse HEAD )
5565
if git -C "${p}" pull --quiet --rebase --stat --autostash
5666
then

0 commit comments

Comments
 (0)