move note to top

This commit is contained in:
Aakansha Doshi 2022-07-04 21:18:05 +05:30
parent 59101a1f33
commit a61f17b1f2
2 changed files with 8 additions and 7 deletions

View file

@ -8,13 +8,10 @@ const excalidrawPackage = `${excalidrawDir}/package.json`;
const originalReadMe = fs.readFileSync(`${excalidrawDir}/README.md`, "utf8");
const updateReadme = () => {
let data = originalReadMe;
const noteIndex = data.indexOf("#### Note");
const installlationIndex = data.indexOf("### Installation");
const excalidrawIndex = originalReadMe.indexOf("### Excalidraw");
// remove note for stable readme
data = data.slice(0, noteIndex) + data.slice(installlationIndex);
const data = originalReadMe.slice(excalidrawIndex);
// update readme
fs.writeFileSync(`${excalidrawDir}/README.md`, data, "utf8");
@ -38,8 +35,8 @@ const release = async (nextVersion) => {
);
// revert readme after release
fs.writeFileSync(`${excalidrawDir}/README.md`, originalReadMe, "utf8");
// /* eslint-disable no-console */
// console.log("Done!");
console.info("Done!");
} catch (error) {
console.error(error);
process.exit(1);