diff --git a/README.md b/README.md index 949b498..31ad102 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ ## STRUCTURE -![flowchart](/docs/flowchart.png) +![flowchart](./docs/flowchart.png) As we find out html are mostly same in react projects, we extract the same html into a template file which lays in `html` folder. @@ -59,3 +59,5 @@ Feel free to submit any issue. - single page support - eslint for code styles + +## diff --git a/scripts/setup.js b/scripts/setup.js index 1e7acbd..f3f2d06 100644 --- a/scripts/setup.js +++ b/scripts/setup.js @@ -100,10 +100,16 @@ const createPackageJSON = async() => { const createREADME = async() => { const filename = `./README.md`; const data = await read(filename); - const data_removed_INITIALIZE = data.replace(/## INITIALIZE.+?#/, '\n#'); - const data_removed_CONTRIBUTE = data_removed_INITIALIZE.replace(/## CONTRIBUTE.+?#/, '\n#'); - const data_removed_TODO = data_removed_CONTRIBUTE.replace(/## TODO.+?\\n/, '\n'); - return await write(filename, data_removed_TODO); + const partsToRemove = [ + `INITIALIZE`, + `CONTRIBUTE`, + `TODO`, + ]; + let data_removed = data; + partsToRemove.forEach((part) => { + data_removed = data_removed.replace(new RegExp(`## ${part}.+?##`), `\n##`); + }); + return await write(filename, data_removed); }; const createCHANGELOG = async() => {