Fix pyinstaller spec for release.

final and buildnumber are optional files. Move them into resources to
avoid naming them explicitly.

(cherry picked from commit fae9650f56)
This commit is contained in:
Dan Albert
2020-11-14 13:01:11 -08:00
parent fad132dcca
commit 96c401e1b9
4 changed files with 7 additions and 7 deletions

View File

@@ -3,11 +3,12 @@ from pathlib import Path
def _build_version_string() -> str:
components = ["2.2.0"]
if Path("buildnumber").exists():
with open("buildnumber", "r") as file:
components.append(file.readline())
build_number_path = Path("resources/buildnumber")
if build_number_path.exists():
with build_number_path.open("r") as build_number_file:
components.append(build_number_file.readline())
if not Path("final").exists():
if not Path("resources/final").exists():
components.append("preview")
return "-".join(components)