From 827003cdd4936f9e0748f5eaec50e7bad9fe8c5a Mon Sep 17 00:00:00 2001 From: Philip Peterson <1326208+philip-peterson@users.noreply.github.com> Date: Sat, 30 Aug 2025 22:07:05 -0700 Subject: [PATCH] Support non-darwin --- bin/mk-snapshot.js | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/bin/mk-snapshot.js b/bin/mk-snapshot.js index abffc3da..6ed78db4 100644 --- a/bin/mk-snapshot.js +++ b/bin/mk-snapshot.js @@ -41,13 +41,22 @@ async function main() { const outputBlobPath = `${baseDirPath}/cache/${npmConfigArch}`; await mkdirp(outputBlobPath); - const mksnapshotBinPath = - require.resolve( - path.join("electron-mksnapshot", "bin", "mksnapshot" + (process.platform === "win32" ? ".exe" : "")) - ); + let mksnapshotBinPath + if (process.platform === 'win32') { + mksnapshotBinPath = + require.resolve( + path.join("electron-mksnapshot", "bin", "mksnapshot.exe") + ); + } else { + mksnapshotBinPath = + require.resolve( + path.join("electron-mksnapshot", "bin", "mksnapshot") + ); + } + + mksnapshotBinPath = path.dirname(mksnapshotBinPath); if (process.platform !== 'darwin') { - // TODO non-darwin const matchingDirs = crossArchDirs.map((dir) => `${mksnapshotBinPath}/${dir}`).filter((dir) => fs.existsSync(dir)); for (const dir of matchingDirs) { if (fs.existsSync(`${mksnapshotBinPath}/gen/v8/embedded.S`)) { @@ -56,7 +65,7 @@ async function main() { } } } - + const startupBlobPath = path.join(outputBlobPath, 'snapshot_blob.bin'); console.log(`Generating startup blob in "${outputBlobPath}"`);