|
1 | 1 | diff --git a/lib/commands/pack/win.js b/lib/commands/pack/win.js |
2 | | -index 9a255a011cbbfb34a337f67bcbabbbffdaf65c11..59cdbd47450e659317bdb9deee18c015d4a41ed3 100644 |
| 2 | +index 9a255a011cbbfb34a337f67bcbabbbffdaf65c11..8b3d11b5b1f2e3487f67915f64873e9cb62929eb 100644 |
3 | 3 | --- a/lib/commands/pack/win.js |
4 | 4 | +++ b/lib/commands/pack/win.js |
5 | | -@@ -332,7 +332,9 @@ the CLI should already exist in a directory named after the CLI that is the root |
| 5 | +@@ -332,7 +332,21 @@ the CLI should already exist in a directory named after the CLI that is the root |
6 | 6 | : []), |
7 | 7 | ]); |
8 | 8 | await (0, fs_extra_1.move)(buildConfig.workspace({ arch, platform: 'win32' }), node_path_1.default.join(installerBase, 'client')); |
9 | 9 | - await exec(`makensis "${installerBase}/${config.bin}.nsi" | grep -v "\\[compress\\]" | grep -v "^File: Descending to"`); |
10 | | -+ await exec(`makensis "${config.bin}.nsi" | grep -v "\\[compress\\]" | grep -v "^File: Descending to"`, { |
11 | | -+ cwd: installerBase, |
12 | | -+ }); |
| 10 | ++ let makensisOutput = ''; |
| 11 | ++ let makensisErrorOutput = ''; |
| 12 | ++ try { |
| 13 | ++ const { stderr, stdout } = await exec(`makensis "${config.bin}.nsi"`, { |
| 14 | ++ cwd: installerBase, |
| 15 | ++ }); |
| 16 | ++ makensisOutput = stdout; |
| 17 | ++ makensisErrorOutput = stderr; |
| 18 | ++ } |
| 19 | ++ catch (error) { |
| 20 | ++ const commandError = error; |
| 21 | ++ const stderr = commandError?.stderr ?? ''; |
| 22 | ++ const stdout = commandError?.stdout ?? ''; |
| 23 | ++ throw new Error(`NSIS command failed in ${installerBase}.\nstdout:\n${stdout}\nstderr:\n${stderr}`); |
| 24 | ++ } |
13 | 25 | const templateKey = (0, upload_util_1.templateShortKey)('win32', { |
14 | 26 | arch, |
15 | 27 | bin: config.bin, |
16 | | -@@ -340,7 +342,11 @@ the CLI should already exist in a directory named after the CLI that is the root |
| 28 | +@@ -340,7 +354,18 @@ the CLI should already exist in a directory named after the CLI that is the root |
17 | 29 | version: config.version, |
18 | 30 | }); |
19 | 31 | const o = buildConfig.dist(`win32/${templateKey}`); |
20 | 32 | - await (0, fs_extra_1.move)(node_path_1.default.join(installerBase, 'installer.exe'), o); |
21 | 33 | + const installerPath = node_path_1.default.join(installerBase, 'installer.exe'); |
22 | 34 | + if (!(await (0, fs_extra_1.pathExists)(installerPath))) { |
23 | | -+ throw new Error(`NSIS did not output installer.exe in ${installerBase}`); |
| 35 | ++ const files = await (0, promises_1.readdir)(installerBase, { recursive: true }); |
| 36 | ++ const fileList = files.map((f) => f.toString()).slice(0, 200).join('\n'); |
| 37 | ++ const outputDir = node_path_1.default.dirname(o); |
| 38 | ++ const outputDirExists = await (0, fs_extra_1.pathExists)(outputDir); |
| 39 | ++ const outputDirFiles = outputDirExists |
| 40 | ++ ? (await (0, promises_1.readdir)(outputDir, { recursive: true })).map((f) => f.toString()).slice(0, 200).join('\n') |
| 41 | ++ : '(output directory does not exist yet)'; |
| 42 | ++ throw new Error(`NSIS did not output installer.exe in ${installerBase}.\nstdout:\n${makensisOutput}\nstderr:\n${makensisErrorOutput}\ninstallerBase files:\n${fileList}\noutputDir (${outputDir}) files:\n${outputDirFiles}`); |
24 | 43 | + } |
25 | 44 | + await (0, fs_extra_1.move)(installerPath, o); |
26 | 45 | const { windows } = config.pjson.oclif; |
|
0 commit comments