do not attempt dot files

This commit is contained in:
AJ ONeal 2015-11-29 01:18:42 +00:00
parent b6493ac916
commit c9c6344682
1 changed files with 7 additions and 4 deletions

View File

@ -39,7 +39,7 @@ module.exports.create = function (conf, deps) {
var fs = PromiseA.promisifyAll(require('fs'));
// deps : { memstore, sqlstores, clientSqlFactory, systemSqlFactory }
// XXX this is a no-no (file system access in a worker, cannot be statically analyzed)
// TODO regenerate a static file of all requires on each install
// TODO read system config db to find which services auto-start
@ -47,8 +47,11 @@ module.exports.create = function (conf, deps) {
return fs.readdirAsync(conf.servicespath).then(function (nodes) {
var promise = PromiseA.resolve();
var services = [];
nodes.forEach(function (node) {
if (!/^\./.test(node)) {
return;
}
promise = promise.then(function () {
return loadService(node).then(function (srv) {
if (!srv) {
@ -90,7 +93,7 @@ module.exports.create = function (conf, deps) {
function startServices(services) {
var promise = PromiseA.resolve();
var servicesMap = {};
services.forEach(function (srv) {
promise = promise.then(function () {
return startService(srv).then(function (service) {
@ -100,7 +103,7 @@ module.exports.create = function (conf, deps) {
}
srv.service = service;
servicesMap[srv.name] = srv;
});
});
});
});