Allow node v0.6.x and 0.8.x
parent
02ce537c68
commit
c01aaeefc1
|
@ -21,9 +21,12 @@ var path = require('path');
|
||||||
var zlib = require('zlib');
|
var zlib = require('zlib');
|
||||||
var util = require('util');
|
var util = require('util');
|
||||||
var settings = require('./Settings');
|
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/'));
|
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 = {};
|
var responseCache = {};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue