File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed
Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change 11/**
2- * Command line implementation for CSScomb
2+ * Command line implementation for CSSComb
33 *
44 * Usage example:
55 * ./node_modules/.bin/csscomb file1 [dir1 [fileN [dirN]]]
@@ -15,19 +15,22 @@ program
1515 . option ( '-c, --config [path]' , 'configuration file path' )
1616 . parse ( process . argv ) ;
1717
18- var comb = new Comb ( ) ;
18+ if ( ! program . args . length ) {
19+ console . log ( 'No input paths specified' ) ;
20+ program . help ( ) ;
21+ }
22+
1923var configPath = program . config || ( process . cwd ( ) + '/.csscomb.json' ) ;
2024
2125if ( fs . existsSync ( configPath ) ) {
26+ var comb = new Comb ( ) ;
2227 comb . configure ( require ( configPath ) ) ;
23- if ( program . args . length > 0 ) {
24- vow . all ( program . args . map ( function ( path ) {
25- return comb . processPath ( path ) ;
26- } ) ) . fail ( function ( e ) {
27- console . log ( 'stack: ' , e . stack ) ;
28- process . exit ( 1 ) ;
29- } ) ;
30- }
28+ vow . all ( program . args . map ( function ( path ) {
29+ return comb . processPath ( path ) ;
30+ } ) ) . fail ( function ( e ) {
31+ console . log ( 'stack: ' , e . stack ) ;
32+ process . exit ( 1 ) ;
33+ } ) ;
3134} else {
3235 console . log ( 'Configuration file ' + configPath + ' was not found.' ) ;
3336 process . exit ( 1 ) ;
You can’t perform that action at this time.
0 commit comments