diff options
Diffstat (limited to 'scripts/create.js')
-rw-r--r-- | scripts/create.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/create.js b/scripts/create.js index b41d6d0..506364a 100644 --- a/scripts/create.js +++ b/scripts/create.js | |||
@@ -21,7 +21,7 @@ const recipeName = process.argv[2]; | |||
21 | const recipe = recipeName.toLowerCase().replace(/\s/g, '-'); | 21 | const recipe = recipeName.toLowerCase().replace(/\s/g, '-'); |
22 | const cleanRecipeId = recipe.replace(/[^a-z]/g, ''); // Clean recipe ID only containing a-z, for usage as the JavaScript class name | 22 | const cleanRecipeId = recipe.replace(/[^a-z]/g, ''); // Clean recipe ID only containing a-z, for usage as the JavaScript class name |
23 | const folderName = process.argv[3] || 'Ferdi'; | 23 | const folderName = process.argv[3] || 'Ferdi'; |
24 | const filesThatNeedTextReplace = ['package.json', 'index.js', 'README.md']; | 24 | const filesThatNeedTextReplace = ['package.json', 'index.js', 'webview.js', 'README.md']; |
25 | 25 | ||
26 | (async () => { | 26 | (async () => { |
27 | // Folder paths | 27 | // Folder paths |
@@ -49,7 +49,7 @@ const filesThatNeedTextReplace = ['package.json', 'index.js', 'README.md']; | |||
49 | await fs.copy(sampleRecipe, newRecipeFolder); | 49 | await fs.copy(sampleRecipe, newRecipeFolder); |
50 | console.log('[Info] Copied recipe'); | 50 | console.log('[Info] Copied recipe'); |
51 | 51 | ||
52 | // Replace "SERVICE" with the service name | 52 | // Replace placeholders with the recipe-specific values |
53 | for (const file of filesThatNeedTextReplace) { | 53 | for (const file of filesThatNeedTextReplace) { |
54 | const filePath = path.join(newRecipeFolder, file); | 54 | const filePath = path.join(newRecipeFolder, file); |
55 | let contents = await fs.readFile(filePath, 'utf-8'); | 55 | let contents = await fs.readFile(filePath, 'utf-8'); |