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

Add support for WSL hosts file #40

Merged
merged 7 commits into from
Mar 16, 2018
Merged

Conversation

JacobDB
Copy link
Contributor

@JacobDB JacobDB commented Jun 16, 2017

This change checks if a hosts file exists at /mnt/c/Windows/System32/drivers/etc/hosts, and if so, attempts to add or remove the virtual host specified. This makes the script more compatible with Microsoft's Windows Subsystem on Linux.

@alanaasmaa
Copy link

+1

@JacobDB
Copy link
Contributor Author

JacobDB commented Aug 14, 2017

Only issue with this is that it can't actually write to Window's HOSTS file unless you change the permissions on it. I'm told there may be something like winsudo in the future to allow this to work properly.

@RoverWire
Copy link
Owner

RoverWire commented Aug 24, 2017

Interesting, let me make some test to ensure it does not affect other cases. Great contribution 👍

@JacobDB
Copy link
Contributor Author

JacobDB commented Feb 6, 2018

Just adjusted this so that it properly writes a Windows-style line ending in the Windows HOSTS file (before it was working, but would behave weirdly if you opened up HOSTS in Windows)

@RoverWire RoverWire merged commit b595dc5 into RoverWire:master Mar 16, 2018
lelinhtinh added a commit to lelinhtinh/virtualhost that referenced this pull request Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants