Permalink
Browse files

correct existsSync

  • Loading branch information...
1 parent 4f64ed9 commit 0e16fc4fa66e73d8e9dd720261dfc327b029c7db Adriano Raiano committed Jun 27, 2012
View
@@ -2,6 +2,7 @@ before_script: "npm install --dev"
language: node_js
node_js:
+ - 0.6
- 0.8
branches:
@@ -1,5 +1,5 @@
var path = require('path')
- , fs = require('fs')
+ , existsSync = require('fs').existsSync || require('path').existsSync
, async = require('async')
, utils = require('../utils')
, _ = require('underscore');
@@ -15,15 +15,15 @@ module.exports = {
var aggregates = {};
- if (!path.existsSync(aggregatesPath)){
+ if (!existsSync(aggregatesPath)){
return callback(null, aggregates);
}
async.waterfall([
function(callback) {
var businessRules = {};
- if (path.existsSync(businessRulesPath)) {
+ if (existsSync(businessRulesPath)) {
utils.path.dive(businessRulesPath, function(err, file) {
var businessRule = require(file);
@@ -1,6 +1,6 @@
var eventEmitter = require('../eventEmitter')
, async = require('async')
- , fs = require('fs')
+ , existsSync = require('fs').existsSync || require('path').existsSync
, utils = require('../utils')
, commandHandlerLoader;
@@ -33,15 +33,15 @@ module.exports = commandHandlerLoader = {
var commandHandlers = [];
- if (!fs.existsSync(commandHandlersPath)){
+ if (!existsSync(commandHandlersPath)){
return callback(null, commandHandlers);
}
async.waterfall([
function(callback) {
var cmdValRules = {};
- if (fs.existsSync(validationRulesPath)) {
+ if (existsSync(validationRulesPath)) {
utils.path.dive(validationRulesPath, function(err, file) {
var validation = require(file);
var aggrName = validation.aggregate;
@@ -1,5 +1,5 @@
var eventEmitter = require('../eventEmitter')
- , fs = require('fs')
+ , existsSync = require('fs').existsSync || require('path').existsSync
, utils = require('../utils')
, sagaHandlerLoader;
@@ -22,7 +22,7 @@ module.exports = sagaHandlerLoader = {
var sagaHandlers = [];
- if (!fs.existsSync(p)){
+ if (!existsSync(p)){
return callback(null, sagaHandlers);
}
@@ -1,5 +1,5 @@
var path = require('path')
- , fs = require('fs')
+ , existsSync = require('fs').existsSync || require('path').existsSync
, utils = require('../utils')
, sagaLoader;
@@ -9,7 +9,7 @@ module.exports = sagaLoader = {
var sagas = {};
- if (!fs.existsSync(p)){
+ if (!existsSync(p)){
return callback(null, sagas);
}

0 comments on commit 0e16fc4

Please sign in to comment.