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

46
kiss
View File

@ -1425,37 +1425,31 @@ pkg_updates() {
set -f
contains "$*" kiss && {
log "Detected package manager update"
log "The package manager will be updated first"
case " $* " in
*" kiss "*)
log "Detected package manager update"
log "The package manager will be updated first"
prompt
prompt
pkg_build kiss
args i kiss
pkg_build kiss
args i kiss
log "Updated the package manager"
log "Re-run 'kiss update' to update your system"
log "Updated the package manager"
log "Re-run 'kiss update' to update your system"
;;
exit 0
}
" ")
log "Everything is up to date"
;;
[ "$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"
*)
log "Packages to update: $*"
pkg_update=1
pkg_build "$@"
log "Updated all packages"
;;
esac
}
pkg_clean() {