mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Implement files.exists in terms of file.statOrNull.
The hitherto-underlying fs.exists function has been deprecated in Node v4. Part of #6921.
This commit is contained in:
@@ -1425,9 +1425,14 @@ wrapFsFunc("readFile", [0], {
|
||||
});
|
||||
wrapFsFunc("stat", [0]);
|
||||
wrapFsFunc("lstat", [0]);
|
||||
wrapFsFunc("exists", [0], {noErr: true});
|
||||
wrapFsFunc("rename", [0, 1]);
|
||||
|
||||
// The fs.exists method is deprecated in Node v4:
|
||||
// https://nodejs.org/api/fs.html#fs_fs_exists_path_callback
|
||||
files.exists = function (path) {
|
||||
return !! files.statOrNull(path);
|
||||
};
|
||||
|
||||
if (process.platform === "win32") {
|
||||
var rename = files.rename;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user