From f60c324c85f3b82a7e3b564c99dc289153ebb441 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Mon, 4 Oct 2021 05:06:00 +0530 Subject: Add check to ensure that generated file 'user.js' is not present in default package --- all.json | 2 +- recipes/erepublik/package.json | 2 +- recipes/erepublik/user.js | 3 --- scripts/package.js | 10 +++++++++- 4 files changed, 11 insertions(+), 6 deletions(-) delete mode 100644 recipes/erepublik/user.js diff --git a/all.json b/all.json index 7ecb530..941c25e 100644 --- a/all.json +++ b/all.json @@ -364,7 +364,7 @@ "featured": false, "id": "erepublik", "name": "eRepublik", - "version": "1.1.2", + "version": "1.1.3", "icons": { "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/recipes/erepublik/icon.svg" } 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 @@ { "id": "erepublik", "name": "eRepublik", - "version": "1.1.2", + "version": "1.1.3", "license": "MIT", "config": { "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 @@ -module.exports = (config, Ferdi) => { - -}; 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) => { for(let recipe of availableRecipes) { const recipeSrc = path.join(recipesFolder, recipe); const packageJson = path.join(recipeSrc, 'package.json'); - const svgIcon = path.join(recipeSrc, 'icon.svg'); // Check that package.json exists if (!await fs.pathExists(packageJson)) { @@ -71,6 +70,7 @@ const compress = (src, dest) => new Promise((resolve, reject) => { } // Check that icons exist + const svgIcon = path.join(recipeSrc, 'icon.svg'); const hasSvg = await fs.pathExists(svgIcon); if (!hasSvg) { 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) => { continue; } + // Check that user.js does not exist + const userJs = path.join(recipeSrc, 'user.js'); + if (await fs.pathExists(userJs)) { + console.log(`⚠️ Couldn't package "${recipe}": Folder contains a "user.js".`); + unsuccessful++; + continue; + } + // Read package.json const config = await fs.readJson(packageJson) -- cgit v1.2.3-54-g00ecf