-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathindex.js
executable file
·78 lines (63 loc) · 1.3 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
'use strict';
var TAG = 'Tournamenter';
/**
* Module dependencies
*/
var async = require('async');
/**
* Global App Object
*/
var app = {
};
/**
* Define Globals
*/
global.app = app;
global._ = require('lodash');
global.chalk = require('chalk');
global.electron = require('electron');
global.eApp = global.electron.app;
global._TAG = function (tag){
return chalk.yellow(`[${tag}]`);
}
/**
* Squirrel Bootstrap
* (Used while Installing/Updating...)
*/
if(require('./config/squirrel')()){
return;
}
/*
* Bootstrap Process
*/
var configSetps = [
// Load configuration options
require('./config/config'),
// Bootstrap Helpers
require('./config/helpers'),
// Bootstrap Models
// require('./config/models'),
// Bootstrap Controllers
require('./config/controllers'),
// Initialize electron
require('./config/electron'),
// Initialize application menu
require('./config/menu'),
];
// Configure steps and initialize
async.eachSeries(configSetps, function (config, next){
config(app, next);
}, function (err){
// Check if an error ocurred during initialization
if(err){
console.error(TAG, 'Failed to initialize BajaSync: %s', err);
throw err;
return
}
// App started OK.
console.log(TAG, chalk.green('App started'));
//
// Launch app
//
app.controllers.App.init();
});