mirror of
https://github.com/status-im/metro.git
synced 2025-02-21 07:18:11 +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
91fb94b5ce
commit
1b33b523f4
11
react-packager/src/SocketInterface/index.js
vendored
11
react-packager/src/SocketInterface/index.js
vendored
@ -49,7 +49,7 @@ const SocketInterface = {
|
||||
sockPath = '\\\\.\\pipe\\' + sockPath
|
||||
}
|
||||
|
||||
if (fs.existsSync(sockPath)) {
|
||||
if (existsSync(sockPath)) {
|
||||
var sock = net.connect(sockPath);
|
||||
sock.on('connect', () => {
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user