@@ -10,18 +10,20 @@ import search from './search';
1010import tutorials from './tutorials' ;
1111import publish from './publish' ;
1212import checkForUpdate from './update' ;
13+ import validate from './validate' ;
1314
1415program
15- . version ( '0.6 .0' )
16+ . version ( '0.7 .0' )
1617 . usage ( '[options] <keywords>' )
1718 . option ( '-b, --build <path/to/tutorial.md>' ,
18- 'tutorial markdown file' , / ^ .+ \. m d $ / i)
19+ 'tutorial markdown file' , / ^ .+ \. m d $ / i)
1920 . option ( '-c, --create <name>' , 'tutorial name' )
2021 . option ( '-p, --publish <version>' ,
21- 'publish tutorial to npm with new version number' )
22+ 'publish tutorial to npm with new version number' )
2223 . option ( '-t, --tutorials' , 'list of local tutorial packages' )
2324 . option ( '-s, --search <query>' , 'search for tutorial package' )
2425 . option ( '-r, --run' , 'run tutorial' )
26+ . option ( '-v, --validate' , 'validate tutorial' )
2527 . parse ( process . argv ) ;
2628
2729checkForUpdate ( ) ;
@@ -68,6 +70,12 @@ if (program.build) {
6870 const version = program . args [ 0 ] ;
6971 publish ( version ) ;
7072
73+ } else if ( program . validate ) {
74+ if ( ! validate ( ) ) {
75+ fail ( ) ;
76+ }
77+
78+ // help
7179} else {
7280 program . help ( ) ;
7381}
0 commit comments