Skip to content

Commit 65029e7

Browse files
committed
Also print stdout on error in a subprocess
1 parent c1151cf commit 65029e7

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,13 @@ function checkVersion(version, allowed) {
100100
async function subprocess(command, options) {
101101
Core.info("[command]" + command.join(" "));
102102
const [file, ...args] = command;
103-
return execFile(file, args, options);
103+
try {
104+
return await execFile(file, args, options);
105+
} catch (error) {
106+
Core.info(error.stdout);
107+
Core.info("---");
108+
throw error;
109+
}
104110
}
105111

106112
async function installCrystalForLinux({crystal, shards, arch = getArch(), path}) {
@@ -251,9 +257,8 @@ async function installShards({shards, path}, crystalPromise) {
251257
async function rebuildShards({path}) {
252258
Core.info("Building Shards");
253259
await subprocess(["make", "clean"], {cwd: path});
254-
const {stdout} = await subprocess(["make"], {cwd: path});
260+
await subprocess(["make"], {cwd: path});
255261
Core.startGroup("Finished building Shards");
256-
Core.info(stdout);
257262
Core.endGroup();
258263
}
259264

0 commit comments

Comments
 (0)