kiss: use case statement for update outcomes

This commit is contained in:
Dylan Araps 2021-07-02 12:25:15 +00:00
parent c02e58c395
commit 7d50b6ec9d
No known key found for this signature in database
GPG Key ID: 13295DAC2CF13B5C
1 changed files with 20 additions and 26 deletions

22
kiss
View File

@ -1425,7 +1425,8 @@ pkg_updates() {
set -f
contains "$*" kiss && {
case " $* " in
*" kiss "*)
log "Detected package manager update"
log "The package manager will be updated first"
@ -1436,26 +1437,19 @@ pkg_updates() {
log "Updated the package manager"
log "Re-run 'kiss update' to update your system"
;;
exit 0
}
[ "$1" ] || {
" ")
log "Everything is up to date"
return
}
;;
*)
log "Packages to update: $*"
# Build all packages requiring an update.
# See [1] at top of script.
# shellcheck disable=2046,2086
{
pkg_update=1
pkg_build "$@"
}
log "Updated all packages"
;;
esac
}
pkg_clean() {