Skip to content

Commit c333465

Browse files
committed
chore: phnode for electron
1 parent 9b50878 commit c333465

3 files changed

Lines changed: 23 additions & 2 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ src-tauri/phnode-*
1919
src-tauri/tauri-local.conf.json
2020
phoenix
2121

22+
# Electron things
23+
src-electron/bin
24+
2225
node_modules
2326
dist
2427
dist-ssr

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-build/downloadNodeBinary.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,24 @@ async function copyLatestNodeForBuild(platform, arch) {
239239
console.log("Error Found:", err);
240240
throw new Error(err);
241241
}
242+
243+
// Also copy to src-electron/bin folder
244+
const electronBinDir = (platform === "win") ? `${__dirname}\\..\\src-electron\\bin` : `${__dirname}/../src-electron/bin`;
245+
const electronBinName = (platform === "win") ? "phnode.exe" : "phnode";
246+
const electronDestNode = (platform === "win") ? `${electronBinDir}\\${electronBinName}` : `${electronBinDir}/${electronBinName}`;
247+
248+
try {
249+
// Ensure the directory exists
250+
if (!fs.existsSync(electronBinDir)) {
251+
fs.mkdirSync(electronBinDir, { recursive: true });
252+
}
253+
fs.copyFileSync(srcNode, electronDestNode);
254+
console.log("File copied to src-electron/bin successfully!");
255+
} catch (err) {
256+
console.log("Error copying to src-electron/bin:", err);
257+
throw new Error(err);
258+
}
259+
242260
await removeDir(fullPathOfNode);
243261
}
244262

0 commit comments

Comments
 (0)