From 36b609831bc551bc60bc0f38756be449ce093e7c Mon Sep 17 00:00:00 2001 From: cybermoloch <57740572+cybermoloch@users.noreply.github.com> Date: Fri, 29 May 2020 07:28:20 -0600 Subject: 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 --- scripts/api/package.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts/api') 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 } let configErrors = []; if (!config.id) { - configErrors.push("Your package.json contains no 'id' field. This field should contain a unique ID made of lowercase letters (a-z) and hyphens (-)"); - } else if (!/^[a-z._\-]+$/.test(config.id)) { - configErrors.push("Your package.json defines an invalid recipe ID. Please make sure the 'id' field only contains lowercase letters (a-z) and hyphens (-)"); + 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 (_)"); + } else if (!/^[a-z0-9._\-]+$/.test(config.id)) { + 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 (_)"); } if (!config.name) { 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 }); console.log(`✅ Successfully packaged and added new recipe "${config.id}"`); -}; \ No newline at end of file +}; -- cgit v1.2.3-54-g00ecf