From 9ef5025c22a66842982b67f8db0c533908e750b2 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 15 Aug 2014 06:41:27 -0400 Subject: [PATCH] feature(ischanged) rm main --- lib/server/ischanged.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/server/ischanged.js b/lib/server/ischanged.js index cf9cde00..18133d5d 100644 --- a/lib/server/ischanged.js +++ b/lib/server/ischanged.js @@ -1,18 +1,22 @@ (function() { 'use strict'; - var main = global.cloudcmd.main, - JSONDIR = main.JSONDIR, + var + DIR_JSON = '../../json/', fs = require('fs'), path = require('path'), Util = require('../util'), time = require('./timem'), - CHANGES_NAME = JSONDIR + 'changes', - CHANGES_JSON = CHANGES_NAME + '.json', + CHANGES_NAME = DIR_JSON + 'changes', + CHANGES_JSON = CHANGES_NAME + '.json', - Times = main.require(CHANGES_NAME) || {}; + Times = {}; + + Util.exec.try(function() { + Times = require(CHANGES_NAME); + }); module.exports = function(name, callback) { var readTime = Times[name];