Created
August 12, 2016 22:39
-
-
Save therealkenc/c9b36e5e648a9525a3461ad009737014 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const os = require("os"); | |
const fs = require("fs"); | |
const Emitter = require('events'); | |
var wslNetworkInterfaces = function() { | |
console.log("WSL has no idea what interfaces are available."); | |
return { | |
"Loopback Pseudo-Interface 1": [ | |
{ | |
"address": "::1", | |
"netmask": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", | |
"family": "IPv6", | |
"mac": "00:00:00:00:00:00", | |
"scopeid": 0, | |
"internal": true | |
}, | |
{ | |
"address": "127.0.0.1", | |
"netmask": "255.0.0.0", | |
"family": "IPv4", | |
"mac": "00:00:00:00:00:00", | |
"internal": true | |
} | |
] | |
}; | |
} | |
class WSLFSWatcher extends Emitter {} | |
var wslWatchFile = function(file) { | |
console.log("WSL isn't really watching " + file.toString()); | |
} | |
var wslUnwatchFile = function(file) { | |
console.log("WSL wasn't really watching " + file.toString()); | |
} | |
var wslWatch = function (file) { | |
console.log("WSL isn't really watching " + file.toString() + | |
" and FSWatcher is lying."); | |
return new WSLFSWatcher(); | |
} | |
console.log("running wsl-shim"); | |
// make it easy to comment out shims | |
os.networkInterfaces = wslNetworkInterfaces; | |
fs.watchFile = wslWatchFile; | |
fs.unwatchFile = wslUnwatchFile; | |
fs.watch = wslWatch; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://blogs.msdn.microsoft.com/commandline/2017/04/11/windows-10-creators-update-whats-new-in-bashwsl-windows-console/
fixed