aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLibravatar Markus Hatvan <markus_hatvan@aon.at>2021-09-08 10:33:47 +0200
committerLibravatar GitHub <noreply@github.com>2021-09-08 10:33:47 +0200
commitb94c29c9890c46bb6388d53bc549cc24f19f0649 (patch)
treeed38a70538414db7e8f6091d6ce5b85e50728354 /scripts
parentRemove dependency on 'require' of 'electron' and 'electron/remote' modules. (diff)
downloadferdium-recipes-b94c29c9890c46bb6388d53bc549cc24f19f0649.tar.gz
ferdium-recipes-b94c29c9890c46bb6388d53bc549cc24f19f0649.tar.zst
ferdium-recipes-b94c29c9890c46bb6388d53bc549cc24f19f0649.zip
build: migrate from npm to pnpm (#603)
Diffstat (limited to 'scripts')
-rw-r--r--scripts/create.js24
1 files changed, 15 insertions, 9 deletions
diff --git a/scripts/create.js b/scripts/create.js
index 506364a..0e785fa 100644
--- a/scripts/create.js
+++ b/scripts/create.js
@@ -6,13 +6,13 @@ const path = require('path');
6const open = require('open'); 6const open = require('open');
7 7
8if (process.argv.length < 3) { 8if (process.argv.length < 3) {
9 console.log(`Usage: npm run create <Recipe name> [Folder name] 9 console.log(`Usage: pnpm run create <Recipe name> [Folder name]
10For example: 10For example:
11npm run create WhatsApp 11pnpm run create WhatsApp
12npm run create "Google Hangouts" 12pnpm run create "Google Hangouts"
13You can set "Folder name" to "FerdiDev" to use Ferdi's development instance instead: 13You can set "Folder name" to "FerdiDev" to use Ferdi's development instance instead:
14 14
15npm run create WhatsApp FerdiDev 15pnpm run create WhatsApp FerdiDev
16`); 16`);
17 return; 17 return;
18} 18}
@@ -25,15 +25,21 @@ const filesThatNeedTextReplace = ['package.json', 'index.js', 'webview.js', 'REA
25 25
26(async () => { 26(async () => {
27 // Folder paths 27 // Folder paths
28 const userData = process.env.APPDATA || (process.platform == 'darwin' ? process.env.HOME + '/Library/Application Support' : process.env.HOME + "/.config"); 28 const userData =
29 const recipesFolder = path.join(userData, folderName, "recipes"); 29 process.env.APPDATA ||
30 const devRecipeFolder = path.join(recipesFolder, "dev"); 30 (process.platform == 'darwin'
31 ? process.env.HOME + '/Library/Application Support'
32 : process.env.HOME + '/.config');
33 const recipesFolder = path.join(userData, folderName, 'recipes');
34 const devRecipeFolder = path.join(recipesFolder, 'dev');
31 const newRecipeFolder = path.join(devRecipeFolder, recipe); 35 const newRecipeFolder = path.join(devRecipeFolder, recipe);
32 const sampleRecipe = path.join(__dirname, 'sample_recipe'); 36 const sampleRecipe = path.join(__dirname, 'sample_recipe');
33 37
34 // Make sure dev recipe folder exists 38 // Make sure dev recipe folder exists
35 if (!await fs.exists(recipesFolder)) { 39 if (!(await fs.exists(recipesFolder))) {
36 console.log(`Couldn't find your recipe folder (${recipesFolder}). Is Ferdi installed?`); 40 console.log(
41 `Couldn't find your recipe folder (${recipesFolder}). Is Ferdi installed?`,
42 );
37 return; 43 return;
38 } 44 }
39 await fs.ensureDir(devRecipeFolder); 45 await fs.ensureDir(devRecipeFolder);