瀏覽代碼

ignore md

Benoît Hubert 1 年之前
父節點
當前提交
26dc5256c5
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      dump-directory-content.js

+ 5 - 1
dump-directory-content.js

@@ -11,6 +11,10 @@ function printDirectoryContent(directoryPath, indent = '') {
   const files = fs.readdirSync(directoryPath);
 
   for (const file of files) {
+    // Should exclude markdown files
+    if (file.endsWith('.md')) {
+      continue;
+    }
     const filePath = path.join(directoryPath, file);
     const stats = fs.statSync(filePath);
 
@@ -22,7 +26,7 @@ function printDirectoryContent(directoryPath, indent = '') {
       const fileExtension = path.extname(filePath).toLowerCase();
       const language = getLanguageFromExtension(fileExtension);
 
-      console.log(indent + '**' + file + '**');
+      console.log(indent + '**' + file + '**\n');
       console.log('```' + language);
       console.log(fileContent);
       console.log('```');