diff --git a/README.md b/README.md index 8c554815d..b9ab31168 100644 --- a/README.md +++ b/README.md @@ -103,3 +103,7 @@ Thanks! 💖 <!-- spellchecker: enable --> <!-- markdownlint-restore --> <!-- prettier-ignore-end --> + +<!-- You can remove this notice if you don't want it 🙂 no worries! --> + +> 💙 This package is based on [@JoshuaKGoldberg](https://github.com/JoshuaKGoldberg)'s [template-typescript-node-package](https://github.com/JoshuaKGoldberg/template-typescript-node-package). diff --git a/script/setup.js b/script/setup.js index b46f6c188..a7e52da84 100644 --- a/script/setup.js +++ b/script/setup.js @@ -126,19 +126,22 @@ try { "./package.json", ], [/## Explainer.*## Usage/s, `## Usage`, "./README.md"], - [ - "<!-- ALL-CONTRIBUTORS-LIST:END -->", - `<!-- ALL-CONTRIBUTORS-LIST:END --> - -<!-- You can remove this notice if you don't want it 🙂 no worries! --> - -> 💙 This package is based on [@JoshuaKGoldberg](https://github.com/JoshuaKGoldberg)'s [template-typescript-node-package](https://github.com/JoshuaKGoldberg/template-typescript-node-package).`, - "./README.md", - ], ]) { await replace({ files, from, to }); } + const endOfReadmeNotice = ` + + <!-- You can remove this notice if you don't want it 🙂 no worries! --> + + > 💙 This package is based on [@JoshuaKGoldberg](https://github.com/JoshuaKGoldberg)'s [template-typescript-node-package](https://github.com/JoshuaKGoldberg/template-typescript-node-package).`; + + if ( + !(await fs.readFile("./README.md")).toString().includes(endOfReadmeNotice) + ) { + await fs.appendFile("./README.md", endOfReadmeNotice); + } + console.log(chalk.gray`✔️ Done.`); console.log();