Skip to content

Commit e87489f

Browse files
committed
Add commit 'distance' to version
1 parent d43b861 commit e87489f

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

nxc/cli.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ def gen_cli_args():
1919

2020
try:
2121
VERSION, COMMIT = importlib.metadata.version("netexec").split("+")
22+
DISTANCE, COMMIT = COMMIT.split(".")
2223
except ValueError:
2324
VERSION = importlib.metadata.version("netexec")
2425
COMMIT = ""
26+
DISTANCE = ""
2527
CODENAME = "NeedForSpeed"
26-
nxc_logger.debug(f"NXC VERSION: {VERSION} - {CODENAME} - {COMMIT}")
28+
nxc_logger.debug(f"NXC VERSION: {VERSION} - {CODENAME} - {COMMIT} - {DISTANCE}")
2729

2830
generic_parser = argparse.ArgumentParser(add_help=False, formatter_class=DisplayDefaultsNotNone)
2931
generic_group = generic_parser.add_argument_group("Generic", "Generic options for nxc across protocols")
@@ -130,7 +132,7 @@ def gen_cli_args():
130132
sys.exit(1)
131133

132134
if args.version:
133-
print(f"{VERSION} - {CODENAME} - {COMMIT}")
135+
print(f"{VERSION} - {CODENAME} - {COMMIT} - {DISTANCE}")
134136
sys.exit(1)
135137

136138
# Multiply output_tries by 10 to enable more fine granural control, see exec methods

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,8 @@ poetry-dynamic-versioning = { version = ">=1.7.0,<2.0.0", extras = ["plugin"] }
7979
[tool.poetry-dynamic-versioning]
8080
enable = true
8181
style = "pep440"
82-
bump = true
8382
pattern = "(?P<base>\\d+\\.\\d+\\.\\d+)"
84-
format = "{base}+{distance}.g{commit}"
83+
format = "{base}+{distance}.{commit}"
8584

8685
[build-system]
8786
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]

0 commit comments

Comments
 (0)