Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@filiptronicek
Created October 12, 2022 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save filiptronicek/9d86b62ddf69b8591adab3438e403ab1 to your computer and use it in GitHub Desktop.
Save filiptronicek/9d86b62ddf69b8591adab3438e403ab1 to your computer and use it in GitHub Desktop.
The old changelog format migrator
import fs from "fs";
// for every file in the directory, make a folder with the same name and move the file into it, renaming it to index.md
const dir = "./src/lib/contents/changelog";
fs.readdirSync(dir).forEach((file) => {
const fileDir = `${dir}/${file}`;
const newDir = `${dir}/${file.split(".")[0]}`;
fs.mkdirSync(newDir);
fs.renameSync(fileDir, `${newDir}/index.md`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment