Skip to content

Commit

Permalink
Explicitly set the home directory in nsswitch.conf (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
ManasJayanth authored and bryphe committed Nov 2, 2018
1 parent 4d4d9f6 commit f322d70
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions build-cygwin.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ const install = async () => {

log(`Installation complete!`)

// Run a command to test it out & create initial script files
cp.spawnSync(path.join(__dirname, ".cygwin", "bin", "bash.exe"), ["-c", "echo hi"]);

// Delete the /var/cache folder, since it's large and we don't need the cache at this point
console.log("Deleting /var/cache...");
rimraf.sync(path.join(__dirname, ".cygwin", "var", "cache"));
Expand All @@ -81,6 +78,20 @@ const install = async () => {
console.log("Copying over defaults...");
fs.copySync(path.join(__dirname, "defaults"), path.join(__dirname, ".cygwin"));
console.log("Defaults copied successfully");

// Explicitly set home directory
try {
fs.appendFileSync(
path.join(__dirname, ".cygwin", "etc", "nsswitch.conf"),
"db_home: /usr/esy"
);
} catch(e) {
console.error("Something went wrong while updating nsswitch.conf");
}

// Run a command to test it out & create initial script files
cp.spawnSync(path.join(__dirname, ".cygwin", "bin", "bash.exe"), ["-c", "echo hi"]);

}

if (os.platform() === "win32") {
Expand Down

0 comments on commit f322d70

Please sign in to comment.