Skip to content

Commit 1ec6c45

Browse files
committed
Update
1 parent d4227b4 commit 1ec6c45

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

generate_toc.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@ function generateTableOfContents(directory) {
1414

1515
if (stats.isDirectory()) {
1616
const folderName = file.charAt(0).toUpperCase() + file.slice(1);
17-
console.log(`Adding folder to TOC: ${folderName}`);
1817
tableOfContents += `${" ".repeat(depth)}- ${folderName}\n`;
1918
traverseDirectory(filePath, depth + 1);
2019
} else if (file.endsWith(".js")) {
2120
const absolutePath = path.join(directory, filePath);
22-
console.log(`Adding JS file to TOC: ${file} - ${absolutePath}`);
2321
tableOfContents += `${" ".repeat(depth)}- [${file}](${absolutePath})\n`;
2422
}
2523
}
@@ -52,6 +50,10 @@ if (markerIndex !== -1) {
5250
console.error("Error writing to README file:", err);
5351
} else {
5452
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!");
5557
}
5658
});
5759
} else {

0 commit comments

Comments
 (0)