From 68a92ed186fec82ca7b0bfcd61706002655c3336 Mon Sep 17 00:00:00 2001 From: Raynos Date: Wed, 11 Apr 2012 16:53:54 +0100 Subject: [PATCH] hack for server/client --- bin/ncore | 3 +++ modules/moduleLoader.js | 8 ++++++++ package.json | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bin/ncore b/bin/ncore index dec5b8e..ee358cc 100755 --- a/bin/ncore +++ b/bin/ncore @@ -40,6 +40,9 @@ function readFiles(err, files) { if (err) { throw err } + files.files = files.files.filter(function (uri) { + return uri.indexOf("/server/") === -1 + }) after.forEach(files.files, tunnelWriteDependencies, done) } diff --git a/modules/moduleLoader.js b/modules/moduleLoader.js index 35a5b5d..e50c632 100644 --- a/modules/moduleLoader.js +++ b/modules/moduleLoader.js @@ -26,6 +26,11 @@ pd.extend(ModuleLoader, { this.core.use(relative, module); this.callback(); } else if (stats.isDirectory()) { + if (this.skip) { + if (this.uri.indexOf(skip) !== -1) { + return this.callback() + } + } fs.readdir(this.uri, this.readFiles); } }, @@ -61,6 +66,7 @@ module.exports = { files in the folder (uri). This is based on files/folderNames uri: {String} - uri of the folder to load + skip: {String} - string to match the folder name again to skip callback: {Function} - callback to invoke when all modules are loaded and attached to core. Passes an error if the error occurs @@ -75,6 +81,7 @@ module.exports = { ModuleLoader({ uri: options.uri, + skip: options.skip, core: options.core, callback: next }) @@ -109,6 +116,7 @@ module.exports = { moduleLoader.load({ uri: uri, core: Core, + skip: "client/" dependencies: require(path.join(uri, "dependency.json")), callback: init }) diff --git a/package.json b/package.json index d722b07..9c1ceb8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ncore", - "version": "1.3.4", + "version": "1.3.5", "description": "Core library for your application", "keywords": ["core", "architecture", "infrastructure"], "author": "Raynos ",