From 81f5e7b3b3f6e2687ebca03e212e0e7bc2da171f Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Sun, 21 Jan 2024 13:25:57 +0100 Subject: feat(version): add command to automatically detect and setup nvchecker Introduce a new version subcommand `setup` which does a best effort to generate the most minimal required .nvchecker.toml file for specific sources. It supports a wide range of common sources like: - Git, GitHub, GitLab, Hackage, NPM, PyPI, RubyGems, CPAN, crates.io The creation logic is based on matching a domain for a source which is something predictable and then simply passes an array of the url parts for every source creator to extract the useful bits out of the url array. Component: pkgctl version setup Co-authored-by: Levente Polyak Signed-off-by: Jelle van der Waa --- src/lib/version.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/lib/version.sh') diff --git a/src/lib/version.sh b/src/lib/version.sh index ac810ae..a18da83 100644 --- a/src/lib/version.sh +++ b/src/lib/version.sh @@ -19,6 +19,7 @@ pkgctl_version_usage() { COMMANDS check Compares local package versions against upstream + setup Automatically detect and setup a basic nvchecker config upgrade Adjust the PKGBUILD to match the latest upstream version OPTIONS @@ -26,6 +27,7 @@ pkgctl_version_usage() { EXAMPLES $ ${COMMAND} check libfoo linux libbar + $ ${COMMAND} setup libfoo _EOF_ } @@ -57,6 +59,14 @@ pkgctl_version() { pkgctl_version_upgrade "$@" exit $? ;; + setup) + _DEVTOOLS_COMMAND+=" $1" + shift + # shellcheck source=src/lib/version/setup.sh + source "${_DEVTOOLS_LIBRARY_DIR}"/lib/version/setup.sh + pkgctl_version_setup "$@" + exit 0 + ;; *) die "invalid argument: %s" "$1" ;; -- cgit v1.2.3-54-g00ecf