Skip to content

Commit

Permalink
Add tagRootRelease configurability.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdlaird committed Oct 18, 2024
1 parent ee5235b commit a43375f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion heliumcli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__copyright__ = "Copyright (c) 2018 Helium Edu"
__license__ = "MIT"
__version__ = "1.6.26"
__version__ = "1.6.27"
2 changes: 1 addition & 1 deletion heliumcli/actions/buildrelease.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def run(self, args):

self._commit_and_tag(project_path, version, config["remoteName"], config["branchName"])

if config["projectsRelativeDir"] != ".":
if config["projectsRelativeDir"] != "." and config["tagRootRelease"]:
root_dir = os.path.abspath(os.path.join(projects_dir, ".."))
if os.path.exists(os.path.join(root_dir, ".git")):
print(utils.get_repo_name(root_dir, config["remoteName"]))
Expand Down
2 changes: 2 additions & 0 deletions heliumcli/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ def get_default_settings():
},
"remoteName": os.environ.get("HELIUMCLI_REMOTE_NAME", "origin"),
"branchName": os.environ.get("HELIUMCLI_BRANCH_NAME", "main"),
"copyrightName": os.environ.get("HELIUMCLI_COPYRIGHT_NAME", None),
"tagRootRelease": os.environ.get("HELIUMCLI_TAG_ROOT_RELEASE", "true") == "true"
}
2 changes: 1 addition & 1 deletion heliumcli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def should_update(line, verification, start_needle, end_needle=""):


def get_copyright_name(): # pragma: no cover
if "copyrightName" in get_config():
if get_config()["copyrightName"]:
return get_config("copyrightName")
else:
with open(os.path.join(get_ansible_dir(), "group_vars", "all.yml"), "r") as lines:
Expand Down
4 changes: 3 additions & 1 deletion tests/testconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,7 @@ def test_custom_config_created(self):
'updateCopyrightYear': True,
"versionInfo": {"path": "some/path/project/version", "project": "proj2"},
"branchName": "fancy-main",
"remoteName": "fancy-origin"
"remoteName": "fancy-origin",
"copyrightName": None,
"tagRootRelease": True
})

0 comments on commit a43375f

Please sign in to comment.