Skip to content

Commit 2715bce

Browse files
committed
fix: update Windows command handling in getSeaCommands function
1 parent 298e96f commit 2715bce

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

nx-node-sea/src/plugin.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,14 @@ function getSeaCommands(options: {
196196
`npx postject ${nodeBinPath} NODE_SEA_BLOB ${blobPath} --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2`,
197197
];
198198
} else if (platform === 'win32') {
199+
const _nodeBinPath = 'node.exe';
199200
return [
200-
`node -e "require('fs').copyFileSync(process.execPath, '${nodeBinPath}.exe')"`,
201-
`signtool remove /s '${nodeBinPath}.exe' `,
201+
`node -e "require('fs').copyFileSync(process.execPath, '${_nodeBinPath}')"`,
202+
`signtool remove /s '${_nodeBinPath}' `,
202203
// TODO: check if powershell or command prompt
203-
`npx postject ${nodeBinPath}.exe NODE_SEA_BLOB ${blobPath} \` --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2`,
204-
...(sign ? [`signtool sign /fd SHA256 ${nodeBinPath}.exe`] : []),
204+
`npx postject ${_nodeBinPath} NODE_SEA_BLOB ${blobPath} \` --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2`,
205+
...(sign ? [`signtool sign /fd SHA256 ${_nodeBinPath}`] : []),
206+
`mv ${_nodeBinPath} ${join(dirname(nodeBinPath), _nodeBinPath)}`,
205207
];
206208
} else {
207209
throw new Error(`Unsupported platform: ${platform}`);

0 commit comments

Comments
 (0)