Skip to content

Commit f950405

Browse files
authored
Merge pull request #2771 from benkwokcy/fix/local-mac-build
Fix macOS local build crash when PYFA_VERSION is unset
2 parents 2a0c78d + 1d6bf30 commit f950405

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,5 +128,8 @@ gitversion
128128
*.fsdbinary
129129
/locale/progress.json
130130

131+
# Generated by db_update.py
132+
eve.db
133+
131134
# vscode settings
132135
.vscode

dist_assets/mac/pyfa.spec

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ label = subprocess.check_output([
1111
with open('.version', 'w+') as f:
1212
f.write(label.decode())
1313

14+
# Use PYFA_VERSION from the environment (set in CI), falling back to the
15+
# git-describe label so local builds don't crash on a None plist value.
16+
pyfa_version = os.getenv('PYFA_VERSION') or label.decode()
17+
1418
block_cipher = None
1519

1620
added_files = [
@@ -88,7 +92,7 @@ coll = COLLECT(
8892
app = BUNDLE(
8993
coll,
9094
name='pyfa.app',
91-
version=os.getenv('PYFA_VERSION'),
95+
version=pyfa_version,
9296
icon=icon,
9397
bundle_identifier=None,
9498
info_plist={
@@ -97,7 +101,7 @@ app = BUNDLE(
97101
'CFBundleName': 'pyfa',
98102
'CFBundleDisplayName': 'pyfa',
99103
'CFBundleIdentifier': 'org.pyfaorg.pyfa',
100-
'CFBundleVersion': os.getenv('PYFA_VERSION'),
101-
'CFBundleShortVersionString': os.getenv('PYFA_VERSION'),
104+
'CFBundleVersion': pyfa_version,
105+
'CFBundleShortVersionString': pyfa_version,
102106
}
103107
)

0 commit comments

Comments
 (0)