diff options
Diffstat (limited to 'scripts/package.js')
-rw-r--r-- | scripts/package.js | 10 |
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 | ||