Skip to content

Commit 76f3a1d

Browse files
authored
fix(dmg-builder): exec python fail on Macos12.3 (#6789)
1 parent d82edbb commit 76f3a1d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.changeset/rare-dolls-sin.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"dmg-builder": patch
3+
---
4+
5+
Fix cannot exec python in MacOS 12.3

packages/dmg-builder/src/dmg.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,11 @@ async function customizeDmg(volumePath: string, specification: DmgOptions, packa
298298
env.iconLocations = await computeDmgEntries(specification, volumePath, packager, asyncTaskManager)
299299
await asyncTaskManager.awaitTasks()
300300
const executePython = async (execName: string) => {
301-
await exec(process.env.PYTHON_PATH || `/usr/bin/${execName}`, [path.join(getDmgVendorPath(), "dmgbuild/core.py")], {
301+
let pythonPath = process.env.PYTHON_PATH
302+
if (!pythonPath) {
303+
pythonPath = (await exec("which", [execName])).trim()
304+
}
305+
await exec(pythonPath, [path.join(getDmgVendorPath(), "dmgbuild/core.py")], {
302306
cwd: getDmgVendorPath(),
303307
env,
304308
})

0 commit comments

Comments
 (0)