aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLibravatar Vijay A <vraravam@users.noreply.github.com>2021-10-04 05:06:00 +0530
committerLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2021-10-04 05:07:47 +0530
commitf60c324c85f3b82a7e3b564c99dc289153ebb441 (patch)
treeab3e34c7c479eaf8e356d2eddce3161dddbbb6e5 /scripts
parentfix: searching repos on github clogs notifications (#729) (diff)
downloadferdium-recipes-f60c324c85f3b82a7e3b564c99dc289153ebb441.tar.gz
ferdium-recipes-f60c324c85f3b82a7e3b564c99dc289153ebb441.tar.zst
ferdium-recipes-f60c324c85f3b82a7e3b564c99dc289153ebb441.zip
Add check to ensure that generated file 'user.js' is not present in default package
Diffstat (limited to 'scripts')
-rw-r--r--scripts/package.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/package.js b/scripts/package.js
index 79db480..0f2ae6f 100644
--- a/scripts/package.js
+++ b/scripts/package.js
@@ -61,7 +61,6 @@ const compress = (src, dest) => new Promise((resolve, reject) => {
61 for(let recipe of availableRecipes) { 61 for(let recipe of availableRecipes) {
62 const recipeSrc = path.join(recipesFolder, recipe); 62 const recipeSrc = path.join(recipesFolder, recipe);
63 const packageJson = path.join(recipeSrc, 'package.json'); 63 const packageJson = path.join(recipeSrc, 'package.json');
64 const svgIcon = path.join(recipeSrc, 'icon.svg');
65 64
66 // Check that package.json exists 65 // Check that package.json exists
67 if (!await fs.pathExists(packageJson)) { 66 if (!await fs.pathExists(packageJson)) {
@@ -71,6 +70,7 @@ const compress = (src, dest) => new Promise((resolve, reject) => {
71 } 70 }
72 71
73 // Check that icons exist 72 // Check that icons exist
73 const svgIcon = path.join(recipeSrc, 'icon.svg');
74 const hasSvg = await fs.pathExists(svgIcon); 74 const hasSvg = await fs.pathExists(svgIcon);
75 if (!hasSvg) { 75 if (!hasSvg) {
76 console.log(`⚠️ Couldn't package "${recipe}": Recipe doesn't contain an icon SVG`); 76 console.log(`⚠️ Couldn't package "${recipe}": Recipe doesn't contain an icon SVG`);
@@ -87,6 +87,14 @@ const compress = (src, dest) => new Promise((resolve, reject) => {
87 continue; 87 continue;
88 } 88 }
89 89
90 // Check that user.js does not exist
91 const userJs = path.join(recipeSrc, 'user.js');
92 if (await fs.pathExists(userJs)) {
93 console.log(`⚠️ Couldn't package "${recipe}": Folder contains a "user.js".`);
94 unsuccessful++;
95 continue;
96 }
97
90 // Read package.json 98 // Read package.json
91 const config = await fs.readJson(packageJson) 99 const config = await fs.readJson(packageJson)
92 100