File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 6
6
*/
7
7
8
8
import * as program from 'commander' ;
9
+ import frontvue from '../core' ;
9
10
10
11
program
11
12
. version ( '0.1.0' )
@@ -18,12 +19,26 @@ program
18
19
19
20
program
20
21
. command ( 'init [name]' )
21
- . action ( name => console . log ( `Creating a new project ./${ name } ` ) )
22
+ . action ( async name => {
23
+ console . log ( `Creating a new project ./${ name } ` ) ;
24
+ const instance = await frontvue ;
25
+ instance . run ( 'init' ) ;
26
+ } )
22
27
. description ( 'Initialize a new project' ) ;
23
28
29
+
24
30
program
25
31
. command ( 'config' )
26
32
. description ( 'Start configuration wizard' )
27
33
. action ( ( ) => console . log ( 'Starting configuration...' ) ) ;
28
34
35
+
36
+ program
37
+ . command ( 'run [hook]' )
38
+ . description ( 'Run tasks in a hook' )
39
+ . action ( async hook => {
40
+ const instance = await frontvue ;
41
+ instance . run ( hook ) ;
42
+ } ) ;
43
+
29
44
program . parse ( process . argv ) ;
You can’t perform that action at this time.
0 commit comments