Comparing version 0.0.1 to 0.0.2
@@ -11,3 +11,3 @@ var events = require('events'); | ||
var that = this; | ||
this.config = new Config(config); | ||
this.config = new Config(config, this); | ||
@@ -14,0 +14,0 @@ // Map of services resolved |
@@ -6,3 +6,5 @@ var _ = require('underscore'); | ||
var Config = function(config) { | ||
var Config = function(config, app) { | ||
var that = this; | ||
this.app = app; | ||
this.config = _.defaults({}, config || {}, { | ||
@@ -23,3 +25,3 @@ 'paths': process.cwd() | ||
this.resolvePackagePath = function(packagePath) { | ||
var result, base, newPath; | ||
var result, base, newPath, maxLevel = 5; | ||
@@ -38,3 +40,3 @@ var returnPath = function() { | ||
base = this.config.paths[0]; | ||
while (base) { | ||
while (base && maxLevel) { | ||
newPath = path.resolve(base, "node_modules", packagePath); | ||
@@ -46,5 +48,7 @@ if (this.checkPackageDirectory(newPath)) { | ||
base = path.resolve(base, '..'); | ||
maxLevel = maxLevel - 1; | ||
} | ||
throw new Error("Can't find '" + packagePath); | ||
var err = new Error("Can't find '" + packagePath); | ||
that.app.emit("error", err); | ||
throw err; | ||
}; | ||
@@ -51,0 +55,0 @@ |
{ | ||
"name": "engineer", | ||
"description": "Powerful plugin system for writing large and extensible NodeJS applications", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"author": "FriendCode <contact@friendco.de>", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
@@ -37,3 +37,3 @@ engineer | ||
console.error("Error in the application:"); | ||
console.error(err, err.stack); | ||
console.error(err.stack); | ||
}); | ||
@@ -40,0 +40,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24762
272