From e87489f8ca4418f9d3223718f29f1a8ee74635bc Mon Sep 17 00:00:00 2001 From: Alexander Neff Date: Sat, 8 Mar 2025 10:13:39 -0500 Subject: [PATCH] Add commit 'distance' to version --- nxc/cli.py | 6 ++++-- pyproject.toml | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/nxc/cli.py b/nxc/cli.py index 582dc453..b97691b6 100755 --- a/nxc/cli.py +++ b/nxc/cli.py @@ -19,11 +19,13 @@ def gen_cli_args(): try: VERSION, COMMIT = importlib.metadata.version("netexec").split("+") + DISTANCE, COMMIT = COMMIT.split(".") except ValueError: VERSION = importlib.metadata.version("netexec") COMMIT = "" + DISTANCE = "" CODENAME = "NeedForSpeed" - nxc_logger.debug(f"NXC VERSION: {VERSION} - {CODENAME} - {COMMIT}") + nxc_logger.debug(f"NXC VERSION: {VERSION} - {CODENAME} - {COMMIT} - {DISTANCE}") generic_parser = argparse.ArgumentParser(add_help=False, formatter_class=DisplayDefaultsNotNone) generic_group = generic_parser.add_argument_group("Generic", "Generic options for nxc across protocols") @@ -130,7 +132,7 @@ def gen_cli_args(): sys.exit(1) if args.version: - print(f"{VERSION} - {CODENAME} - {COMMIT}") + print(f"{VERSION} - {CODENAME} - {COMMIT} - {DISTANCE}") sys.exit(1) # Multiply output_tries by 10 to enable more fine granural control, see exec methods diff --git a/pyproject.toml b/pyproject.toml index 422e492c..bc64b8e4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -79,9 +79,8 @@ poetry-dynamic-versioning = { version = ">=1.7.0,<2.0.0", extras = ["plugin"] } [tool.poetry-dynamic-versioning] enable = true style = "pep440" -bump = true pattern = "(?P\\d+\\.\\d+\\.\\d+)" -format = "{base}+{distance}.g{commit}" +format = "{base}+{distance}.{commit}" [build-system] requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]