Allow node v0.6.x and 0.8.x

pull/829/head
Marcel Klehr 2012-07-05 17:34:23 +02:00
parent 02ce537c68
commit c01aaeefc1
1 changed files with 4 additions and 1 deletions

View File

@ -21,9 +21,12 @@ var path = require('path');
var zlib = require('zlib');
var util = require('util');
var settings = require('./Settings');
var semver = require('semver');
var existsSync = (semver.satisfies(process.version, '>=0.8.0')) ? fs.existsSync : path.existsSync
var CACHE_DIR = path.normalize(path.join(settings.root, 'var/'));
CACHE_DIR = fs.existsSync(CACHE_DIR) ? CACHE_DIR : undefined;
CACHE_DIR = existsSync(CACHE_DIR) ? CACHE_DIR : undefined;
var responseCache = {};