Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly set the home directory in nsswitch.conf #35

Merged
merged 1 commit into from
Nov 2, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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