From f94d1879dc321a2d1c864901862c92b57ea74722 Mon Sep 17 00:00:00 2001 From: erik Date: Wed, 22 Feb 2023 10:27:07 +0100 Subject: [PATCH] Implement release type calculation --- services.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/services.py b/services.py index 542a2ba..8da851d 100644 --- a/services.py +++ b/services.py @@ -1,26 +1,24 @@ from version_repository import VersionRepository from release_type import ReleaseType +from git_repository import GitRepository class InitReleaseService(): def __init__(self, commit_id, file): self.commit_id = commit_id self.file = file - self.version_repo = None - - def __read_commit_message(self): - pass + self.version_repo = None def __calculate_release_type(self): - pass - + return GitRepository().get_release_type_from_latest_commit() + def get_version(self, release_type): self.version_repo = VersionRepository(self.file) return self.version_repo.get_version(release_type) def create_release_version(self): commit_message = self.read_commit_message(self.commit_id) - release_type = self.calculate_release_type(commit_message) + release_type = self.__calculate_release_type(commit_message) version = self.get_version(release_type).create_release_version() self.version_repo.write_file(version.get_version_string())