Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pontos-release] Optimize Print output #134

Merged
merged 2 commits into from
Jun 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Calendar Versioning](https://calver.org).

## [Unreleased]
### Added
* Added some output to `version` helper. [#134](https://github.com/greenbone/pontos/pull/134)
### Changed
### Deprecated
### Removed
Expand Down
6 changes: 4 additions & 2 deletions pontos/version/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
CMakeVersionCommand,
VersionError,
)
from pontos.terminal import error, ok


def get_next_dev_version(release_version: str) -> str:
Expand Down Expand Up @@ -56,10 +57,11 @@ def get_current_version() -> str:
for file_name, cmd in available_cmds:
project_definition_path = Path.cwd() / file_name
if project_definition_path.exists():
ok(f"Found {file_name} project definition file.")
current_version: str = cmd().get_current_version()
return current_version

print("No project settings file found")
error("No project settings file found")
sys.exit(1)


Expand Down Expand Up @@ -96,7 +98,7 @@ def calculate_calendar_version() -> str:
)
return str(release_version)
else:
print(
error(
f"'{str(current_version)}' is higher than "
f"'{str(today.year % 100)}.{str(today.month)}'."
)
Expand Down