aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--all.json2
-rw-r--r--recipes/erepublik/package.json2
-rw-r--r--recipes/erepublik/user.js3
-rw-r--r--scripts/package.js10
4 files changed, 11 insertions, 6 deletions
diff --git a/all.json b/all.json
index 7ecb530..941c25e 100644
--- a/all.json
+++ b/all.json
@@ -364,7 +364,7 @@
364 "featured": false, 364 "featured": false,
365 "id": "erepublik", 365 "id": "erepublik",
366 "name": "eRepublik", 366 "name": "eRepublik",
367 "version": "1.1.2", 367 "version": "1.1.3",
368 "icons": { 368 "icons": {
369 "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/recipes/erepublik/icon.svg" 369 "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/recipes/erepublik/icon.svg"
370 } 370 }
diff --git a/recipes/erepublik/package.json b/recipes/erepublik/package.json
index 2e8356a..7eb95d7 100644
--- a/recipes/erepublik/package.json
+++ b/recipes/erepublik/package.json
@@ -1,7 +1,7 @@
1{ 1{
2 "id": "erepublik", 2 "id": "erepublik",
3 "name": "eRepublik", 3 "name": "eRepublik",
4 "version": "1.1.2", 4 "version": "1.1.3",
5 "license": "MIT", 5 "license": "MIT",
6 "config": { 6 "config": {
7 "serviceURL": "https://erepublik.com" 7 "serviceURL": "https://erepublik.com"
diff --git a/recipes/erepublik/user.js b/recipes/erepublik/user.js
deleted file mode 100644
index b7e3573..0000000
--- a/recipes/erepublik/user.js
+++ /dev/null
@@ -1,3 +0,0 @@
1module.exports = (config, Ferdi) => {
2
3};
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