aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLibravatar cybermoloch <57740572+cybermoloch@users.noreply.github.com>2020-05-29 07:28:20 -0600
committerLibravatar GitHub <noreply@github.com>2020-05-29 18:58:20 +0530
commit36b609831bc551bc60bc0f38756be449ce093e7c (patch)
tree1cc1e460fde06fc87b63b214534d8d0f12e90ee8 /scripts
parentMerge pull request #182 from dafeder/riseup (diff)
downloadferdium-recipes-36b609831bc551bc60bc0f38756be449ce093e7c.tar.gz
ferdium-recipes-36b609831bc551bc60bc0f38756be449ce093e7c.tar.zst
ferdium-recipes-36b609831bc551bc60bc0f38756be449ce093e7c.zip
Fix for packaging not allowing numbers in recipe ids (#158)
* Add numbers to regex and fix error message Added numbers to regex assuming that would still be a valid id. (Existing recipes have numbers in the id!) The regex also allows periods and underscores so added that to the message (assuming that is also still a valid id). * Updated 2nd error message
Diffstat (limited to 'scripts')
-rw-r--r--scripts/api/package.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/api/package.js b/scripts/api/package.js
index 9c3ede5..f66f8d4 100644
--- a/scripts/api/package.js
+++ b/scripts/api/package.js
@@ -93,9 +93,9 @@ For more information about the package.json file visit https://github.com/getfer
93 } 93 }
94 let configErrors = []; 94 let configErrors = [];
95 if (!config.id) { 95 if (!config.id) {
96 configErrors.push("Your package.json contains no 'id' field. This field should contain a unique ID made of lowercase letters (a-z) and hyphens (-)"); 96 configErrors.push("Your package.json contains no 'id' field. This field should contain a unique ID made of lowercase letters (a-z), numbers (0-9), hyphens (-), periods (.), and underscores (_)");
97 } else if (!/^[a-z._\-]+$/.test(config.id)) { 97 } else if (!/^[a-z0-9._\-]+$/.test(config.id)) {
98 configErrors.push("Your package.json defines an invalid recipe ID. Please make sure the 'id' field only contains lowercase letters (a-z) and hyphens (-)"); 98 configErrors.push("Your package.json defines an invalid recipe ID. Please make sure the 'id' field only contains lowercase letters (a-z), numbers (0-9), hyphens (-), periods (.), and underscores (_)");
99 } 99 }
100 if (!config.name) { 100 if (!config.name) {
101 configErrors.push("Your package.json contains no 'name' field. This field should contain the name of the service (e.g. 'Google Keep')"); 101 configErrors.push("Your package.json contains no 'name' field. This field should contain the name of the service (e.g. 'Google Keep')");
@@ -187,4 +187,4 @@ For more information about the webview.js file visit https://github.com/getferdi
187 }); 187 });
188 188
189 console.log(`✅ Successfully packaged and added new recipe "${config.id}"`); 189 console.log(`✅ Successfully packaged and added new recipe "${config.id}"`);
190}; \ No newline at end of file 190};