aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2023-07-26 16:35:49 +0000
committerLibravatar GitHub <noreply@github.com>2023-07-26 22:05:49 +0530
commitf9e2d9926e4dff14df0f13858a9c695e2118a94e (patch)
tree53f1cad4edde7436fa521deb002e14830809bb8b /scripts
parentchore: improve lint setup (#397) (diff)
downloadferdium-recipes-f9e2d9926e4dff14df0f13858a9c695e2118a94e.tar.gz
ferdium-recipes-f9e2d9926e4dff14df0f13858a9c695e2118a94e.tar.zst
ferdium-recipes-f9e2d9926e4dff14df0f13858a9c695e2118a94e.zip
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
Diffstat (limited to 'scripts')
-rw-r--r--scripts/create.js7
-rw-r--r--scripts/package.js1
2 files changed, 5 insertions, 3 deletions
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 @@
1/* eslint-disable no-console */ 1/* eslint-disable no-console */
2
2/** 3/**
3 * Create a new recipe for your service 4 * Create a new recipe for your service
4 */ 5 */
@@ -74,9 +75,9 @@ const pascalCasedName = toPascalCase(recipe); // PascalCased recipe ID only cont
74 for (const file of filesThatNeedTextReplace) { 75 for (const file of filesThatNeedTextReplace) {
75 const filePath = path.join(newRecipeFolder, file); 76 const filePath = path.join(newRecipeFolder, file);
76 let contents = fs.readFileSync(filePath, 'utf8'); 77 let contents = fs.readFileSync(filePath, 'utf8');
77 contents = contents.replace(/SERVICE/g, recipe); 78 contents = contents.replaceAll('SERVICE', recipe);
78 contents = contents.replace(/SNAME/g, recipeName); 79 contents = contents.replaceAll('SNAME', recipeName);
79 contents = contents.replace(/SPASCAL/g, pascalCasedName); 80 contents = contents.replaceAll('SPASCAL', pascalCasedName);
80 fs.writeFileSync(filePath, contents); 81 fs.writeFileSync(filePath, contents);
81 } 82 }
82 console.log('[Info] Prepared new recipe'); 83 console.log('[Info] Prepared new recipe');
diff --git a/scripts/package.js b/scripts/package.js
index 0482775..c2e2ab7 100644
--- a/scripts/package.js
+++ b/scripts/package.js
@@ -1,4 +1,5 @@
1/* eslint-disable no-console */ 1/* eslint-disable no-console */
2
2/** 3/**
3 * Package all recipes 4 * Package all recipes
4 */ 5 */