From e6f7aa395fabc7eca1ee4d93e454d2551cea505c Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Sun, 5 Nov 2023 16:11:12 +0100 Subject: feat(version): introduce version check subcommand The version subcommand handles pkgver related commands, the first subcommand being `check`. Check runs nvchecker if a `.nvchecker.toml` file exists and compares the current pkgver with the latest release. Introduces nvchecker as optional dependency which has to be installed in order to use this particular subcommand. BREAKING CHANGE: formerly pkgctl version would output the version of the pkgctl tool, now it is used as a version related subcommand. Fixes #140 Component: pkgctl version Component: pkgctl version check Co-authored-by: Christian Heusel --- src/pkgctl.in | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/pkgctl.in') diff --git a/src/pkgctl.in b/src/pkgctl.in index 070e0cd..9deb4b2 100644 --- a/src/pkgctl.in +++ b/src/pkgctl.in @@ -27,7 +27,7 @@ usage() { release Release step to commit, tag and upload build artifacts repo Manage Git packaging repositories and their configuration search Search for an expression across the GitLab packaging group - version Show pkgctl version information + version Package version related commands OPTIONS -h, --help Show this help text @@ -39,6 +39,12 @@ if (( $# < 1 )); then exit 1 fi +pkgctl_version_print() { + cat <<- _EOF_ + pkgctl @buildtoolver@ +_EOF_ +} + export _DEVTOOLS_COMMAND='pkgctl' setup_workdir @@ -114,14 +120,20 @@ while (( $# )); do pkgctl_search "$@" exit 0 ;; - version|--version|-V) + version) _DEVTOOLS_COMMAND+=" $1" shift - # shellcheck source=src/lib/version/version.sh - source "${_DEVTOOLS_LIBRARY_DIR}"/lib/version/version.sh + # shellcheck source=src/lib/version.sh + source "${_DEVTOOLS_LIBRARY_DIR}"/lib/version.sh pkgctl_version "$@" exit 0 ;; + --version|-V) + _DEVTOOLS_COMMAND+=" $1" + shift + pkgctl_version_print + exit 0 + ;; *) die "invalid command: %s" "$1" ;; -- cgit v1.2.3-70-g09d2