|
9 | 9 | } from '@nx/devkit'; |
10 | 10 | import { calculateHashForCreateNodes } from '@nx/devkit/src/utils/calculate-hash-for-create-nodes'; |
11 | 11 | import { existsSync } from 'node:fs'; |
12 | | -import { dirname, join } from 'node:path'; |
| 12 | +import { dirname, join, posix, win32 } from 'node:path'; |
13 | 13 | import { platform, versions } from 'node:process'; |
14 | 14 | import { combineGlobPatterns } from 'nx/src/utils/globs'; |
15 | 15 | import { workspaceDataDirectory } from 'nx/src/utils/cache-directory'; |
@@ -196,14 +196,17 @@ function getSeaCommands(options: { |
196 | 196 | `npx postject ${nodeBinPath} NODE_SEA_BLOB ${blobPath} --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2`, |
197 | 197 | ]; |
198 | 198 | } else if (platform === 'win32') { |
199 | | - const _nodeBinPath = 'node.exe'; |
| 199 | + const _nodeBinPath = join( |
| 200 | + dirname(nodeBinPath.replaceAll(posix.sep, win32.sep)), |
| 201 | + 'node.exe' |
| 202 | + ); |
| 203 | + const _blobPath = blobPath.replaceAll(posix.sep, win32.sep); |
200 | 204 | return [ |
201 | 205 | `node -e "require('fs').copyFileSync(process.execPath, '${_nodeBinPath}')"`, |
202 | 206 | ...(sign ? [`signtool remove /s '${_nodeBinPath}' `] : []), |
203 | 207 | // TODO: check if powershell or command prompt |
204 | | - `npx postject ${_nodeBinPath} NODE_SEA_BLOB ${blobPath} \` --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8bß5df1996b2`, |
| 208 | + `npx postject ${_nodeBinPath} NODE_SEA_BLOB ${_blobPath} \` --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8bß5df1996b2`, |
205 | 209 | ...(sign ? [`signtool sign /fd SHA256 ${_nodeBinPath}`] : []), |
206 | | - `mv ${_nodeBinPath} ${join(dirname(nodeBinPath), _nodeBinPath)}`, |
207 | 210 | ]; |
208 | 211 | } else { |
209 | 212 | throw new Error(`Unsupported platform: ${platform}`); |
|
0 commit comments