Fix #1309 : Fix support for node v0.6

This commit is contained in:
Marcel Klehr 2012-12-31 15:47:42 +01:00
parent d9ef9f5648
commit b6c9b4ec30
1 changed files with 3 additions and 1 deletions

View File

@ -5,6 +5,8 @@ var languages = require('languages4translatewiki')
, _ = require('underscore')
, 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
;
@ -17,7 +19,7 @@ function getAllLocales() {
// into `locales2paths` (files from various dirs are grouped by lang code)
// (only json files with valid language code as name)
function extractLangs(dir) {
if(!fs.existsSync(dir)) return;
if(!existsSync(dir)) return;
var stat = fs.lstatSync(dir);
if (!stat.isDirectory() || stat.isSymbolicLink()) return;