diff --git a/lib/util/cli.js b/lib/util/cli.js index ee40133c7..d43360d53 100644 --- a/lib/util/cli.js +++ b/lib/util/cli.js @@ -72,6 +72,19 @@ const Cli = { type: 'input', name: 'updateNotificationNotes', message: `Please enter email addresses separated by a comma:`, + // eslint-disable-next-line jsdoc/require-jsdoc + validate: function (emails) { + const response = emails + .split(',') + .map((email) => { + if (!Util.emailValidator(email)) { + Util.logger.info(` ☇ skipping ${email}' - invalid email address`); + } + return email.trim(); + }) + .filter((email) => Util.emailValidator(email)); + return response.length > 0; + }, } ); try {