Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(update): add flag (self, all) #139

Merged
merged 5 commits into from
May 4, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions zap.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ function _zap_update() {

local _plugin _plug _status

[[ "$1" == "-a" || "$1" == "--all" ]] && { echo "\nUpdating All Plugins\n"; for _plug in ${ZAP_INSTALLED_PLUGINS[@]}; do _pull "$ZAP_PLUGIN_DIR/$_plug"; done; return 0; }

function _check() {
git -C "$1" remote update &> /dev/null
case $(LANG=en_US git -C "$1" status -uno | grep -Eo '(ahead|behind|up to date)') in
Expand Down Expand Up @@ -120,11 +122,11 @@ function _zap_help() {
Usage: zap <command>

COMMANDS:
clean Remove unused plugins
help Show this help message
list List plugins
update Update plugins
version Show version information"
clean Remove unused plugins
help Show this help message
list List plugins
update [-a, --all] Update plugins
version Show version information"
}

function _zap_version() {
Expand All @@ -144,7 +146,7 @@ function zap() {
version "_zap_version"
)
emulate -L zsh
[[ -z "$subcmds[$1]" ]] && { _zap_help; return 1 } || ${subcmds[$1]}
[[ -z "$subcmds[$1]" ]] && { _zap_help; return 1 } || ${subcmds[$1]} $2
}

# vim: ft=zsh ts=4 et
Expand All @@ -155,3 +157,4 @@ function zap() {
# 13: Failed to checkout
# 14: Failed to pull
# 15: Nothing to remove