Skip to content

Commit 11b558e

Browse files
committed
build-cygwin: log why initial bash command would fail
1 parent 70ea709 commit 11b558e

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

build-cygwin.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,22 @@ const install = async () => {
9494
}
9595

9696
// Run a command to test it out & create initial script files
97-
cp.spawnSync(path.join(__dirname, ".cygwin", "bin", "bash"), [
97+
let { signal, status, error } = cp.spawnSync(path.join(__dirname, ".cygwin", "bin", "bash"), [
9898
"-lc",
9999
"cd ~ && pwd",
100-
]);
100+
], { stdio: 'inherit' });
101+
102+
if (status !== 0) {
103+
if (status !== null) {
104+
console.error("Initial bash command got killed with status", status);
105+
}
106+
if (signal) {
107+
console.error("Initial bash command got killed by signal", signal);
108+
}
109+
if (error) {
110+
console.log("Initial bash command got killed because of the error", error);
111+
}
112+
}
101113

102114
console.log("Verifying esy profile set up...");
103115
const bashRcContents = fs.readFileSync(path.join(__dirname, ".cygwin", "usr", "esy", ".bashrc")).toString("utf8");

0 commit comments

Comments
 (0)