diff options
author | Bennett <hello@vantezzen.io> | 2020-09-22 20:56:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-22 19:56:48 +0100 |
commit | 6f5e4a00588aefdda7a5a1cfe70935870e7e234a (patch) | |
tree | 9e29aa7aa0620a1a4a968ff8739b4b8ba96791a9 /scripts/load.js | |
parent | Updated logos for Outlook/OWA (diff) | |
download | ferdium-recipes-6f5e4a00588aefdda7a5a1cfe70935870e7e234a.tar.gz ferdium-recipes-6f5e4a00588aefdda7a5a1cfe70935870e7e234a.tar.zst ferdium-recipes-6f5e4a00588aefdda7a5a1cfe70935870e7e234a.zip |
Unpack recipes and update recipes icons (#292)
Co-authored-by: Amine Mouafik <amine@mouafik.fr>
Diffstat (limited to 'scripts/load.js')
-rw-r--r-- | scripts/load.js | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/scripts/load.js b/scripts/load.js deleted file mode 100644 index 3c11240..0000000 --- a/scripts/load.js +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | /** | ||
2 | * Load recipe into development folder | ||
3 | */ | ||
4 | const fs = require('fs-extra'); | ||
5 | const path = require('path'); | ||
6 | |||
7 | console.log('load: Load recipe into development folder'); | ||
8 | console.log('This command will empty the recipe_src folder. Please make sure that there are no important files in that directory.'); | ||
9 | |||
10 | const recipe = process.argv[2]; | ||
11 | if (!recipe) { | ||
12 | console.log('Usage: yarn load [recipe]'); | ||
13 | return; | ||
14 | } | ||
15 | |||
16 | console.log(`Loading ${recipe}`); | ||
17 | |||
18 | // Create paths to important files | ||
19 | const recipeSrc = path.join(__dirname, 'recipe_src'); | ||
20 | const recipePkg = path.join(__dirname, '../', 'uncompressed', recipe); | ||
21 | |||
22 | // Let us work in an async environment | ||
23 | (async () => { | ||
24 | // Check that recipe folder exists | ||
25 | if (!await fs.pathExists(recipePkg)) { | ||
26 | console.log(`Error: Recipe ${recipe} does not exist.`); | ||
27 | return; | ||
28 | } | ||
29 | |||
30 | console.log('Emptying directory...'); | ||
31 | |||
32 | await fs.emptyDir(recipeSrc); | ||
33 | |||
34 | console.log('Copying data...'); | ||
35 | |||
36 | await fs.copy(recipePkg, recipeSrc); | ||
37 | |||
38 | console.log('Done'); | ||
39 | })(); \ No newline at end of file | ||