Skip to content

Commit

Permalink
When building release, respect copyright year config setting.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdlaird committed Oct 18, 2024
1 parent 84b9766 commit 97a9f61
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 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.28"
__version__ = "1.6.29"
8 changes: 4 additions & 4 deletions heliumcli/actions/buildrelease.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
__license__ = "MIT"

import datetime
import git
import os
import shutil
import sys

import git

from .prepcode import PrepCodeAction
from .. import utils

Expand Down Expand Up @@ -110,8 +109,9 @@ def _update_version_file(self, version, path):
if version_file_path.endswith(".py"):
if line.strip().startswith("__version__ ="):
line = f"__version__ = \"{version}\"\n"
elif line.strip().startswith("__copyright__ = "):
line = "__copyright__ = \"Copyright {year}, {name}\"\n".format(
elif utils.get_config()["updateCopyrightYear"] and \
line.strip().startswith("__copyright__ = "):
line = "__copyright__ = \"Copyright (c) {year}, {name}\"\n".format(
year=str(datetime.date.today().year), name=utils.get_copyright_name())
elif version_file.name == "package.json":
if line.strip().startswith("\"version\":"):
Expand Down
2 changes: 1 addition & 1 deletion heliumcli/actions/prepcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def _process_python_line(self, line):
return line, True
elif utils.get_config()["updateCopyrightYear"] and \
utils.should_update(line,
f"__copyright__ = \"Copyright {self._current_year}, "
f"__copyright__ = \"Copyright (c) {self._current_year}, "
f"{self._copyright_name}\"",
"__copyright__ = ",
f"{self._copyright_name}\""):
Expand Down

0 comments on commit 97a9f61

Please sign in to comment.