Skip to content

Commit 7e37d6e

Browse files
windows: list output
1 parent a035435 commit 7e37d6e

File tree

2 files changed

+29
-10
lines changed

2 files changed

+29
-10
lines changed

patches/oclif@4.22.81.patch

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,45 @@
11
diff --git a/lib/commands/pack/win.js b/lib/commands/pack/win.js
2-
index 9a255a011cbbfb34a337f67bcbabbbffdaf65c11..59cdbd47450e659317bdb9deee18c015d4a41ed3 100644
2+
index 9a255a011cbbfb34a337f67bcbabbbffdaf65c11..8b3d11b5b1f2e3487f67915f64873e9cb62929eb 100644
33
--- a/lib/commands/pack/win.js
44
+++ 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
66
: []),
77
]);
88
await (0, fs_extra_1.move)(buildConfig.workspace({ arch, platform: 'win32' }), node_path_1.default.join(installerBase, 'client'));
99
- 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+
+ }
1325
const templateKey = (0, upload_util_1.templateShortKey)('win32', {
1426
arch,
1527
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
1729
version: config.version,
1830
});
1931
const o = buildConfig.dist(`win32/${templateKey}`);
2032
- await (0, fs_extra_1.move)(node_path_1.default.join(installerBase, 'installer.exe'), o);
2133
+ const installerPath = node_path_1.default.join(installerBase, 'installer.exe');
2234
+ 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}`);
2443
+ }
2544
+ await (0, fs_extra_1.move)(installerPath, o);
2645
const { windows } = config.pjson.oclif;

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)