Description:
Add version calculation.
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
@@ -7,6 +7,7 | |||||
|
7 | import subprocess |
|
7 | import subprocess |
|
8 | import os |
|
8 | import os |
|
9 | import pathlib |
|
9 | import pathlib |
|
|
10 | import datetime | ||
|
10 |
|
11 | ||
|
11 | template_directory = pathlib.Path("PackageTemplates/") |
|
12 | template_directory = pathlib.Path("PackageTemplates/") |
|
12 | macos_template = template_directory / "isometric-park-template.app" |
|
13 | macos_template = template_directory / "isometric-park-template.app" |
@@ -17,6 +18,22 | |||||
|
17 | destination_directory = pathlib.Path("isometric-park-fna/bin/") |
|
18 | destination_directory = pathlib.Path("isometric-park-fna/bin/") |
|
18 |
|
19 | ||
|
19 |
|
20 | ||
|
|
21 | start_date = datetime.datetime(2019, 1, 1) | ||
|
|
22 | |||
|
|
23 | |||
|
|
24 | def months_betweeen(start, end): | ||
|
|
25 | return ((end.year - start.year) * 12) + (end.month - start.month) | ||
|
|
26 | |||
|
|
27 | |||
|
|
28 | def create_version_string(): | ||
|
|
29 | today = datetime.datetime.today() | ||
|
|
30 | months = months_betweeen(start_date, today) + 1 | ||
|
|
31 | |||
|
|
32 | version_string = f"0.{months}.{today.strftime('%d')}" | ||
|
|
33 | |||
|
|
34 | print(f"Version string: {version_string}") | ||
|
|
35 | |||
|
|
36 | |||
|
20 | def make_linux(suffix="new"): |
|
37 | def make_linux(suffix="new"): |
|
21 | new_name = destination_directory / (linux_template.name[:-9] + "-" + suffix) |
|
38 | new_name = destination_directory / (linux_template.name[:-9] + "-" + suffix) |
|
22 | # shutil.rmtree(new_name) |
|
39 | # shutil.rmtree(new_name) |
@@ -160,6 +177,8 | |||||
|
160 | make_source(sys.argv[2]) |
|
177 | make_source(sys.argv[2]) |
|
161 | else: |
|
178 | else: |
|
162 | make_source() |
|
179 | make_source() |
|
|
180 | elif command.lower() == "version": | ||
|
|
181 | create_version_string() | ||
|
163 | else: |
|
182 | else: |
|
164 | pass |
|
183 | pass |
|
165 |
|
184 |
You need to be logged in to leave comments.
Login now