Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src/lib/version.sh
diff options
context:
space:
mode:
authorLevente Polyak <anthraxx@archlinux.org>2024-01-18 19:15:22 +0100
committerLevente Polyak <anthraxx@archlinux.org>2024-01-22 19:45:10 +0100
commite3edf25554c78e28679b100e24c55c87ee65a22d (patch)
treeb630bf07cc736fe986140154bb8f576e62afe9d4 /src/lib/version.sh
parentb258bb3b7c55d06bad108400450acd32cff05366 (diff)
feat(version): use exit code for check to indicate out-of-date versions
It can be handy to have an exit code that allows better status indication or chaining. On exit, return one of the following codes: - 0: Normal exit condition, all checked versions are up-to-date - 1: Unknown cause of failure - 2: Normal exit condition, but there are out-of-date versions - 3: Failed to run some version checks Component: pkgctl version check Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
Diffstat (limited to 'src/lib/version.sh')
-rw-r--r--src/lib/version.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/version.sh b/src/lib/version.sh
index 14cd810..4340fca 100644
--- a/src/lib/version.sh
+++ b/src/lib/version.sh
@@ -47,7 +47,7 @@ pkgctl_version() {
# shellcheck source=src/lib/version/check.sh
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/version/check.sh
pkgctl_version_check "$@"
- exit 0
+ exit $?
;;
upgrade)
_DEVTOOLS_COMMAND+=" $1"
@@ -55,7 +55,7 @@ pkgctl_version() {
# shellcheck source=src/lib/version/upgrade.sh
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/version/upgrade.sh
pkgctl_version_upgrade "$@"
- exit 0
+ exit $?
;;
*)
die "invalid argument: %s" "$1"