-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrellis.js
30 lines (21 loc) · 875 Bytes
/
trellis.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var path = require('path'),
Settings = require('settings'),
settingsDecorator = require('./settingsDecorator.js'),
Winston = require('winston');
module.exports = function() {
var trellis = {};
trellis.settings = new Settings(path.join(process.cwd(), 'config', 'environment.js')).getEnvironment('test');
trellis.logger = new Winston.Logger({
transports: [new Winston.transports.Console(trellis.settings.logger.console)]
});
trellis.logger.setLevels(Winston.config.syslog.levels);
trellis.logger.debug('Logger initialized');
settingsDecorator(trellis);
trellis.logger.debug('Loading bundle manager');
trellis.bundle = require('./bundle/manager.js')(trellis);
trellis.get = trellis.bundle.get;
trellis.settings.bundle.directories.forEach(function(bundleRoot) {
trellis.bundle.loadPath(path.join(process.cwd(), bundleRoot));
});
return trellis;
}();