Merge pull request #2986 from Gared/fix_existssync_deprecated

Use fs.statSync instead of fs.existsSync (deprecated)
pull/2998/head
Stefan 2016-06-07 21:30:22 +02:00
commit 5a868254e3
2 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@ var languages = require('languages4translatewiki')
, npm = require('npm')
, plugins = require('ep_etherpad-lite/static/js/pluginfw/plugins.js').plugins
, semver = require('semver')
, existsSync = semver.gt(process.version, '0.7.0') ? fs.existsSync : path.existsSync
, existsSync = fs.statSync || fs.existsSync || path.existsSync
;

View File

@ -22,7 +22,7 @@ var zlib = require('zlib');
var settings = require('./Settings');
var semver = require('semver');
var existsSync = (semver.satisfies(process.version, '>=0.8.0')) ? fs.existsSync : path.existsSync;
var existsSync = fs.statSync || fs.existsSync || path.existsSync;
var CACHE_DIR = path.normalize(path.join(settings.root, 'var/'));
CACHE_DIR = existsSync(CACHE_DIR) ? CACHE_DIR : undefined;