File tree Expand file tree Collapse file tree 3 files changed +23
-12
lines changed
Expand file tree Collapse file tree 3 files changed +23
-12
lines changed Original file line number Diff line number Diff line change @@ -9,17 +9,16 @@ module.exports = {
99 } ,
1010
1111 sources : [ {
12- path : "./src/index .html" ,
13- collection : "module-views " ,
12+ path : "./test_files/test .html" ,
13+ collection : "static_html " ,
1414 document_id : "5f08bf3da588c11bf8ead4b3" ,
1515 name : "html" ,
1616 } ,
1717 {
18- collection : "website-pages " ,
18+ collection : "test " ,
1919 document_id : "" ,
20- name : "html" ,
21- domains : [ "ws.cocreate.app" ] ,
22- route : "/signup" ,
20+ domains : [ "cocreate.app" ] ,
21+ route : "/docs/boilerplate" ,
2322 }
2423 ] ,
2524
Original file line number Diff line number Diff line change 99 description : ' successful'
1010runs :
1111 using : ' node12'
12- main : ' ./ src/CoCreate-docs.js'
12+ main : ' src/CoCreate-docs.js'
1313
1414
1515
Original file line number Diff line number Diff line change @@ -67,15 +67,27 @@ class ExtractComment {
6767const extractInstance = new ExtractComment ( )
6868
6969function CoCreateExtract ( directory , ignoreFolders , extensions ) {
70+ let extensionsStr = "*" ;
71+ let ignoreFolderStr = "" ;
7072
71- extensions = extensions . join ( ',' ) ;
72- ignoreFolders = ignoreFolders . join ( '|' ) ;
73- let result = [ ] ;
73+ if ( extensions && extensions . length > 0 ) {
74+ extensionsStr = extensions . join ( ',' ) ;
75+ }
76+
77+ if ( ignoreFolders && ignoreFolders . length > 0 ) {
78+ ignoreFolderStr = ignoreFolders . join ( '|' ) ;
79+ }
7480
75- const files = glob . sync ( directory + `/**/*.{${ extensions } }` , { } ) ;
81+ let result = [ ] ;
82+
83+ if ( ! directory ) {
84+ directory = "." ;
85+ }
86+
87+ const files = glob . sync ( directory + `/**/*.{${ extensionsStr } }` , { } ) ;
7688
7789 files . forEach ( ( file ) => {
78- var regex = new RegExp ( ignoreFolders , 'g' ) ;
90+ var regex = new RegExp ( ignoreFolderStr , 'g' ) ;
7991 if ( ! regex . test ( file ) ) {
8092 const docData = extractInstance . run ( file , 'docs' , 'description' ) ;
8193 if ( docData . length > 0 ) {
You can’t perform that action at this time.
0 commit comments