Skip to content

Commit b28cd6c

Browse files
committed
More logs and make reading .bashrc optional
1 parent 11b558e commit b28cd6c

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

build-cygwin.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,12 @@ const install = async () => {
8989
path.join(__dirname, ".cygwin", "etc", "nsswitch.conf"),
9090
"\ndb_home: /usr/esy\n"
9191
);
92+
console.log("Successfully updated nsswitch.conf");
9293
} catch(e) {
9394
console.error("Something went wrong while updating nsswitch.conf");
9495
}
9596

96-
// Run a command to test it out & create initial script files
97+
console.log("Run a command to test it out & create initial script files");
9798
let { signal, status, error } = cp.spawnSync(path.join(__dirname, ".cygwin", "bin", "bash"), [
9899
"-lc",
99100
"cd ~ && pwd",
@@ -111,9 +112,13 @@ const install = async () => {
111112
}
112113
}
113114

114-
console.log("Verifying esy profile set up...");
115-
const bashRcContents = fs.readFileSync(path.join(__dirname, ".cygwin", "usr", "esy", ".bashrc")).toString("utf8");
116-
console.log("Esy user profile setup!");
115+
try {
116+
console.log("Verifying esy profile set up...");
117+
const bashRcContents = fs.readFileSync(path.join(__dirname, ".cygwin", "usr", "esy", ".bashrc")).toString("utf8");
118+
console.log("Esy user profile setup! Found the following at /usr/esy/.bashrc", bashRcContents);
119+
} catch(e) {
120+
console.error("Something went wrong while reading /usr/esy/.bashrc", e);
121+
}
117122
}
118123

119124
if (os.platform() === "win32") {

0 commit comments

Comments
 (0)