File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -14,12 +14,10 @@ function generateTableOfContents(directory) {
14
14
15
15
if ( stats . isDirectory ( ) ) {
16
16
const folderName = file . charAt ( 0 ) . toUpperCase ( ) + file . slice ( 1 ) ;
17
- console . log ( `Adding folder to TOC: ${ folderName } ` ) ;
18
17
tableOfContents += `${ " " . repeat ( depth ) } - ${ folderName } \n` ;
19
18
traverseDirectory ( filePath , depth + 1 ) ;
20
19
} else if ( file . endsWith ( ".js" ) ) {
21
20
const absolutePath = path . join ( directory , filePath ) ;
22
- console . log ( `Adding JS file to TOC: ${ file } - ${ absolutePath } ` ) ;
23
21
tableOfContents += `${ " " . repeat ( depth ) } - [${ file } ](${ absolutePath } )\n` ;
24
22
}
25
23
}
@@ -52,6 +50,10 @@ if (markerIndex !== -1) {
52
50
console . error ( "Error writing to README file:" , err ) ;
53
51
} else {
54
52
console . log ( "README file updated successfully!" ) ;
53
+ // Commit the changes using Git
54
+ execSync ( 'git add README.md' ) ;
55
+ execSync ( 'git commit -m "Update table of contents in README"' ) ;
56
+ console . log ( "Changes committed successfully!" ) ;
55
57
}
56
58
} ) ;
57
59
} else {
You can’t perform that action at this time.
0 commit comments