From f9e2d9926e4dff14df0f13858a9c695e2118a94e Mon Sep 17 00:00:00 2001 From: Vijay Aravamudhan Date: Wed, 26 Jul 2023 16:35:49 +0000 Subject: Improve lint setup (#400) * Use strict configuration of node/npm/pnpm * When generating a new recipe, string replace should handle all placeholders in a single file --- scripts/create.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'scripts/create.js') diff --git a/scripts/create.js b/scripts/create.js index 158b2f2..872b527 100644 --- a/scripts/create.js +++ b/scripts/create.js @@ -1,4 +1,5 @@ /* eslint-disable no-console */ + /** * Create a new recipe for your service */ @@ -74,9 +75,9 @@ const pascalCasedName = toPascalCase(recipe); // PascalCased recipe ID only cont for (const file of filesThatNeedTextReplace) { const filePath = path.join(newRecipeFolder, file); let contents = fs.readFileSync(filePath, 'utf8'); - contents = contents.replace(/SERVICE/g, recipe); - contents = contents.replace(/SNAME/g, recipeName); - contents = contents.replace(/SPASCAL/g, pascalCasedName); + contents = contents.replaceAll('SERVICE', recipe); + contents = contents.replaceAll('SNAME', recipeName); + contents = contents.replaceAll('SPASCAL', pascalCasedName); fs.writeFileSync(filePath, contents); } console.log('[Info] Prepared new recipe'); -- cgit v1.2.3-70-g09d2