mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
Fixed path check
This commit is contained in:
parent
85cdb1cf4e
commit
6b9711cb70
3 changed files with 17 additions and 3 deletions
15
src/node/utils/path_exists.js
Normal file
15
src/node/utils/path_exists.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
var fs = require('fs');
|
||||
|
||||
var check = function(path) {
|
||||
var existsSync = fs.statSync || fs.existsSync || path.existsSync;
|
||||
|
||||
var result;
|
||||
try {
|
||||
result = existsSync(path);
|
||||
} catch (e) {
|
||||
result = false;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = check;
|
Loading…
Add table
Add a link
Reference in a new issue