-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
executable file
·37 lines (31 loc) · 973 Bytes
/
index.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
31
32
33
34
35
36
37
#!/usr/bin/env node
/**
*
* The main application which loads the spaces configuration.
*
* @author Salvatore Garbesi <[email protected]>
* @module index
*
* @return {undefined} Nothing is returned from this Function.
*
**/
module.exports = (function() {
'use strict';
// Load the Boostrap.
require(require('path').join(__dirname, '/bootstrap'));
// If no configuration file is missing.
if (_.isString(_.get(cli, 'config')) === false) {
// Throw a error to console.
log.error('No configuration file specified.');
// Stop the Function.
return;
}
// Load and normalize the configuration for the instance.
var config = app.controller.config.boot(cli.config);
// If the configuration failed to normalize, or there's no `space`(s) to process, stop the Function.
if (config === false || config.space.length === 0) {
return;
}
// Iterate through each of the space(s) and load them.
_.each(config.space, app.controller.space.boot.bind(null, config));
}());