mirror of https://github.com/status-im/metro.git
Get rid of deprecated `fs.existSync`
Reviewed By: mmahoney Differential Revision: D2824569 fb-gh-sync-id: efed6e88f566110b8286ea59563c2904b3dd8059
This commit is contained in:
parent
91fb94b5ce
commit
1b33b523f4
|
@ -49,7 +49,7 @@ const SocketInterface = {
|
||||||
sockPath = '\\\\.\\pipe\\' + sockPath
|
sockPath = '\\\\.\\pipe\\' + sockPath
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fs.existsSync(sockPath)) {
|
if (existsSync(sockPath)) {
|
||||||
var sock = net.connect(sockPath);
|
var sock = net.connect(sockPath);
|
||||||
sock.on('connect', () => {
|
sock.on('connect', () => {
|
||||||
SocketClient.create(sockPath).then(
|
SocketClient.create(sockPath).then(
|
||||||
|
@ -135,4 +135,13 @@ function createServer(resolve, reject, options, sockPath) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function existsSync(filename) {
|
||||||
|
try {
|
||||||
|
fs.accessSync(filename);
|
||||||
|
return true;
|
||||||
|
} catch(ex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = SocketInterface;
|
module.exports = SocketInterface;
|
||||||
|
|
Loading…
Reference in New Issue