mirror of
https://github.com/status-im/react-native.git
synced 2025-02-05 14:13:26 +00:00
Get rid of deprecated fs.existSync
Reviewed By: mmahoney Differential Revision: D2824569 fb-gh-sync-id: efed6e88f566110b8286ea59563c2904b3dd8059
This commit is contained in:
parent
801b83da2d
commit
51621b14cb
@ -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…
x
Reference in New Issue
Block a user