@@ -13,41 +13,46 @@ module.exports.templates = {
13
13
wiki : utils . buildWiki
14
14
} ;
15
15
16
- module . exports . parseInput = function ( input , config , pkg ) {
16
+ module . exports . parseInput = function ( inputs , config , pkg ) {
17
17
18
18
var files = [ ] ,
19
19
stat ;
20
20
21
- if ( fs . existsSync ( input ) ) {
21
+ if ( ! Array . isArray ( inputs ) ) {
22
22
23
- stat = fs . statSync ( input ) ;
23
+ inputs = [ inputs ] ;
24
24
25
- if ( stat . isDirectory ( ) ) {
25
+ }
26
26
27
- utils . walk ( input ) . forEach ( function ( file ) {
27
+ inputs . forEach ( function ( input ) {
28
28
29
- files . push ( {
30
- name : file . replace ( input , '' ) . replace ( / ^ [ \. \/ ] { 1 , 2 } / , '' ) ,
31
- contents : fs . readFileSync ( file , 'utf8' )
32
- } ) ;
29
+ if ( fs . existsSync ( input ) ) {
33
30
34
- } ) ;
31
+ stat = fs . statSync ( input ) ;
35
32
36
- } else if ( stat . isFile ( ) ) {
33
+ if ( stat . isDirectory ( ) ) {
37
34
38
- files . push ( {
39
- name : path . basename ( input ) ,
40
- contents : fs . readFileSync ( input , 'utf8' )
41
- } ) ;
35
+ utils . walk ( input ) . forEach ( function ( file ) {
42
36
43
- }
37
+ files . push ( {
38
+ name : file . replace ( input , '' ) . replace ( / ^ [ \. \/ ] { 1 , 2 } / , '' ) ,
39
+ contents : fs . readFileSync ( file , 'utf8' )
40
+ } ) ;
44
41
45
- } else {
42
+ } ) ;
46
43
47
- process . stdout . write ( 'File or directory not found.\n' ) ;
48
- process . kill ( ) ;
44
+ } else if ( stat . isFile ( ) ) {
49
45
50
- }
46
+ files . push ( {
47
+ name : input ,
48
+ contents : fs . readFileSync ( input , 'utf8' )
49
+ } ) ;
50
+
51
+ }
52
+
53
+ }
54
+
55
+ } ) ;
51
56
52
57
return exports . parseScripts ( files , config , pkg ) ;
53
58
0 commit comments