Skip to content

Commit

Permalink
Make post processing recurse through folders.
Browse files Browse the repository at this point in the history
  • Loading branch information
joethei authored Feb 21, 2024
1 parent 7d990d8 commit 43e0152
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/post-process.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const targetDir = folderPath;
// Read the folder contents
async function renameFiles(folderPath) {
try {
const files = await fs.readdir(folderPath);
const files = await fs.readdir(folderPath, {recursive: true});

for (const file of files) {
// Step 1: Replace escaped backtick with normal backtick
Expand All @@ -30,7 +30,7 @@ async function renameFiles(folderPath) {

// Step 2: Remove all "obsidian." prefixes
if (file.startsWith('obsidian.') && file.endsWith('.md')) {
const newFileName = file.replace('obsidian.', '').replace('Plugin_2', 'Plugin').replaceAll('Plugin\_2', 'Plugin');
const newFileName = file.replace('obsidian.', '').replace('Plugin_2', 'Plugin').replace('Plugin\_2', 'Plugin');
const oldFilePath = path.join(folderPath, file);
const newFilePath = path.join(folderPath, newFileName);

Expand Down

0 comments on commit 43e0152

Please sign in to comment.