diff --git a/config/development.json b/config/development.json index 6c513bc..749f04a 100644 --- a/config/development.json +++ b/config/development.json @@ -6,5 +6,8 @@ "name" : "heimcontroljs", "port" : "27017", "user" : {} + }, + "plugins": { + "exclude": [] } } \ No newline at end of file diff --git a/heimcontrol.js b/heimcontrol.js index f66c206..4dd02fc 100755 --- a/heimcontrol.js +++ b/heimcontrol.js @@ -173,7 +173,7 @@ requirejs([ 'http', 'connect', 'mongodb', 'path', 'express', 'node-conf', 'socke // 404 Not found app.all('*', Routes.notFound); - }); + }, config.plugins.exclude); } }); }); diff --git a/libs/PluginHelper.js b/libs/PluginHelper.js index fee2b1a..cc27524 100755 --- a/libs/PluginHelper.js +++ b/libs/PluginHelper.js @@ -47,12 +47,20 @@ define([ 'fs' ], function( fs ) { * @param {String} callback.err null if no error occured, otherwise the error * @param {Object} callback.result An array containing the plugins */ - PluginHelper.prototype.getPluginList = function(callback) { + PluginHelper.prototype.getPluginList = function(callback, excludes) { var pluginList = []; var that = this; var files = fs.readdirSync(that.pluginFolder); var requirejs = require('requirejs'); + // Remove excluded plugins from the files list + for(key in excludes) { + var plugin = excludes[key]; + var index = files.indexOf(plugin); + if( index > -1) + files.splice(index, 1); + } + function requireRecursive(files) { var file = files.shift(); // results in alphabetical order requirejs([that.pluginFolder + '/' + file + '/index.js'], function(Plugin) {