Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updated to support windows

  • Loading branch information...
commit 3db3d7c7eaa0e816d1c238c2b726e6126d246602 1 parent 6d81df5
@speier speier authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/localhose.js
View
10 lib/localhose.js
@@ -1,11 +1,13 @@
var fs = require( "fs" )
+ , path = require( "path" )
, exec = require( "child_process" ).exec
, Localhoses = function(){}
-
-if ( process.platform != "darwin" ) throw "Sorry, only tested on OS X."
-
+ , platform = process.platform
+
+if ( platform != "darwin" && platform != "win32" ) throw "Sorry, only tested on OS X and Windows."
+
Localhoses.prototype = {
- hostsPath: "/private/etc/hosts",
+ hostsPath: ( platform == "darwin" ) ? "/private/etc/hosts" : path.join(process.env["WinDir"], "System32", "drivers", "etc", "hosts"),
header:
"# <localhose>",
Please sign in to comment.
Something went wrong with that request. Please try again.