forked from hejob/fireball
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathapp.js
51 lines (42 loc) · 1.29 KB
/
app.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
var Fs = require('fire-fs');
var Path = require('fire-path');
//
global.__app = {
path: __dirname,
initCommander: function ( commander ) {
commander
.usage('[options] <project-path>')
.option('--require-login', 'Require login in dev mode.')
.option('--runtime', 'The runtime name. (Only available when create a project in command mode)')
.option('--template', 'The template name. (Only available when create a project in command mode)')
;
},
init: function ( options, cb ) {
var projectPath;
if ( options.args.length > 0 ) {
projectPath = options.args[0];
}
//
var subinit;
if ( Editor.devMode === 'packages' ) {
subinit = require('./package-studio/init');
}
else {
// if we have project path, go to the studio, otherwise go to the dashboard
if ( projectPath ) {
subinit = require('./canvas-studio/init');
} else {
subinit = require('./dashboard/init');
}
}
if ( subinit ) {
subinit( options, cb );
return;
}
//
if ( cb ) {
cb ();
}
},
};
require('./editor-framework/init');