-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Conversation
Do you think it would be better to check for out-of-date plugins and only show those that need to be updated? local _plugin _plug _status _out_of_date
function _check() {
git -C "$1" remote update &> /dev/null
_out_of_date=false
case $(LANG=en_US git -C "$1" status -uno | grep -Eo '(ahead|behind|up to date)') in
ahead)
_status='\033[1;34mLocal ahead remote\033[0m' ;;
behind)
_status='\033[1;33mOut of date\033[0m'
_out_of_date=true ;;
'up to date')
_status='\033[1;32mUp to date\033[0m' ;;
*)
_status='\033[1;31mDiverged state\033[0m' ;;
esac
}
[[ "$1" == "-a" || "$1" == "--all" ]] && { for _plug in ${ZAP_INSTALLED_PLUGINS[@]}; do _check "$ZAP_PLUGIN_DIR/$_plug"; $_out_of_date && _pull "$ZAP_PLUGIN_DIR/$_plug"; done; return; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make it as suggested in #123
[[ $1 = "self" ]] && { _pull $ZAP_DIR; return }
[[ $1 = "all" ]] && { for _plug in ${ZAP_INSTALLED_PLUGINS[@]}; do _pull "$ZAP_PLUGIN_DIR/$_plug"; done; return }
Is more clear when you want to update all plugins to run zap update all
instead of using --all
option.
In addition the zap update self
is useful for updating zap itself without entering the interactive menu (all
doesn't update zap itself).
Lastly the return
without value returns the status code of the last executed command.
Hi! I have made the changes you requested in #123: I've updated the _zap_update() function to support the self and all options as you suggested: Using Please review the changes and let me know if you have any feedback. Thanks! |
Thanks for your contribution @LoneExile |
I make some changes from #123
Please let me know if any changes or improvements are needed, and I'll be happy to make the necessary adjustments. Thank you for considering this contribution!