Skip to content

Commit 74d6887

Browse files
committed
fix: try to resolve windows build error
1 parent bf36c72 commit 74d6887

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

scripts/build.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { execSync } from 'node:child_process'
2-
import { existsSync, mkdirSync } from 'node:fs'
2+
import { chmodSync, existsSync, mkdirSync } from 'node:fs'
33
import { join } from 'node:path'
44

55
const WIN_OUTPUT_NAME = 'Git_Commit_Analytics_win.exe'
@@ -19,10 +19,21 @@ async function buildWin() {
1919
`node -e "require('fs').copyFileSync(process.execPath, '${OUTPUT_PATH}')" `,
2020
)
2121

22+
if (existsSync(OUTPUT_PATH)) {
23+
console.log(`✅ The file was successfully copied to: ${OUTPUT_PATH}`)
24+
} else {
25+
console.error(`❌ Copy failed, file not found: ${OUTPUT_PATH}`)
26+
process.exit(1)
27+
}
28+
2229
try {
2330
execSync(`signtool remove /s ${OUTPUT_PATH}`)
2431
} catch {}
2532

33+
try {
34+
chmodSync(OUTPUT_PATH, 0o666)
35+
} catch {}
36+
2637
execSync(
2738
[
2839
`postject ${OUTPUT_PATH} NODE_SEA_BLOB ${SEA_BLOB}`,
@@ -47,6 +58,13 @@ async function buildMac() {
4758

4859
execSync(`cp ${NODE_PATH} ${OUTPUT_PATH}`)
4960

61+
if (existsSync(OUTPUT_PATH)) {
62+
console.log(`✅ The file was successfully copied to: ${OUTPUT_PATH}`)
63+
} else {
64+
console.error(`❌ Copy failed, file not found: ${OUTPUT_PATH}`)
65+
process.exit(1)
66+
}
67+
5068
execSync(`codesign --remove-signature ${OUTPUT_PATH}`)
5169

5270
execSync(

0 commit comments

Comments
 (0)