Skip to content

Commit

Permalink
Dynamically update the copyright year
Browse files Browse the repository at this point in the history
  • Loading branch information
Motschen committed Dec 26, 2024
1 parent 76471d1 commit e6ebe7a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
Binary file modified Better-Leaves-9.0.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion gen_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def writeMetadata(args):
if isinstance(edition, list): edition = " ".join(args.edition)
with open("./input/pack.mcmeta") as infile, open("pack.mcmeta", "w") as outfile:
for line in infile:
line = line.replace("${version}", args.version).replace("${edition}", edition)
line = line.replace("${version}", args.version).replace("${edition}", edition).replace("${year}", str(time.localtime().tm_year))
outfile.write(line)

# See https://stackoverflow.com/a/1855118
Expand Down
2 changes: 1 addition & 1 deletion input/pack.mcmeta
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"pack": {
"pack_format": 15,
"supported_formats": [15, 99],
"description": "§2Version ${version} §a${edition}\n§e©Motschen 2024 | MIT Licence"
"description": "§2Version ${version} §a${edition}\n§e©Motschen ${year} | MIT Licence"
}
}

0 comments on commit e6ebe7a

Please sign in to comment.