@@ -11,60 +11,71 @@ async function cli() {
11
11
prog
12
12
. version ( version )
13
13
. description ( 'CLI for easily make slides with Markdown' )
14
-
15
14
. command ( 'init' , 'Create a configure file' )
15
+ . option ( '-b <directory>' , 'A base path' , prog . STRING , process . cwd ( ) )
16
16
. option ( '-t [type]' , 'Schema type' , prog . STRING )
17
17
. action ( ( args , options , logger ) => {
18
18
resolve ( {
19
19
type : 'init' ,
20
20
options : {
21
+ basePath : options . b ,
21
22
schema : options . t ,
22
23
} ,
23
24
} ) ;
24
25
} )
25
26
26
27
. command ( 'start' , 'Start with webpack-dev-server' )
28
+ . option ( '-b <directory>' , 'A base path' , prog . STRING , process . cwd ( ) )
27
29
. option ( '-i <directory>' , 'A directory to load' , prog . STRING , 'slides' )
28
30
. option ( '-p <port>' , 'Dev server port' , prog . INT , '8080' )
29
31
. action ( ( args , options , logger ) => {
30
32
resolve ( {
31
33
type : 'start' ,
32
34
options : {
35
+ basePath : options . b ,
33
36
inputDir : options . i ,
34
37
port : options . p ,
35
38
} ,
36
39
} ) ;
37
40
} )
38
41
39
42
. command ( 'build' , 'Build with webpack' )
43
+ . option ( '-b <directory>' , 'A base path' , prog . STRING , process . cwd ( ) )
40
44
. option ( '-i <directory>' , 'A directory to load' , prog . STRING , 'slides' )
41
45
. option ( '-o <directory>' , 'A directory to output' , prog . STRING , 'dist' )
42
46
. action ( ( args , options , logger ) => {
43
47
resolve ( {
44
48
type : 'build' ,
45
49
options : {
50
+ basePath : options . b ,
46
51
inputDir : options . i ,
47
52
outputDir : options . o ,
48
53
} ,
49
54
} ) ;
50
55
} )
51
56
52
57
. command ( 'deploy' , 'Deploy to GitHub pages' )
58
+ . option ( '-b <directory>' , 'A base path' , prog . STRING , process . cwd ( ) )
53
59
. option ( '-i <directory>' , 'A directory to load' , prog . STRING , 'dist' )
54
60
. action ( ( args , options , logger ) => {
55
61
resolve ( {
56
62
type : 'deploy' ,
57
- options : { outputDir : options . i } ,
63
+ options : {
64
+ basePath : options . b ,
65
+ outputDir : options . i
66
+ } ,
58
67
} ) ;
59
68
} )
60
69
61
70
. command ( 'pdf' , 'Export as PDF' )
71
+ . option ( '-b <directory>' , 'A base path' , prog . STRING , process . cwd ( ) )
62
72
. option ( '-i <directory>' , 'A directory to load' , prog . STRING , 'dist' )
63
73
. option ( '-f <directory>' , 'A filename of pdf' , prog . STRING , 'slide.pdf' )
64
74
. action ( ( args , options , logger ) => {
65
75
resolve ( {
66
76
type : 'pdf' ,
67
77
options : {
78
+ basePath : options . b ,
68
79
inputDir : options . i ,
69
80
filename : options . f ,
70
81
} ,
0 commit comments