11#! /usr/bin/env node
22
33import * as program from 'commander' ;
4- import { grey } from 'chalk' ;
4+ import { grey , yellow } from 'chalk' ;
55import { success , fail } from './result' ;
66
77import build from './build' ;
@@ -19,7 +19,7 @@ program
1919 . option ( '-c, --create [name]' , 'tutorial name' )
2020 . option ( '-p, --publish [version]' ,
2121 'publish tutorial to npm with new version number' )
22- . option ( '-t, --tutorials' , 'list of tutorial packages' )
22+ . option ( '-t, --tutorials' , 'list of local tutorial packages' )
2323 . option ( '-s, --search [query]' , 'search for tutorial package' )
2424 . option ( '-r, --run' , 'run tutorial' )
2525 . parse ( process . argv ) ;
@@ -55,9 +55,13 @@ if (program.build) {
5555 fail ( ) ;
5656 } else {
5757 process . stdout . write ( '\n' ) ;
58- tuts . forEach ( ( tut ) => {
59- process . stdout . write ( ` ${ tut . name } : ${ tut . version } \n` ) ;
60- } ) ;
58+ if ( tuts . length < 1 ) {
59+ process . stdout . write ( yellow ( ` No tutorials in this directory.` ) ) ;
60+ } else {
61+ tuts . forEach ( ( tut ) => {
62+ process . stdout . write ( ` ${ tut . name } : ${ tut . version } \n` ) ;
63+ } ) ;
64+ }
6165 }
6266
6367} else if ( program . publish ) {
0 commit comments