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

46
kiss
View File

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