diff --git a/lib/plugins/create/create.js b/lib/plugins/create/create.js index b199afd7b..6523dc938 100644 --- a/lib/plugins/create/create.js +++ b/lib/plugins/create/create.js @@ -38,10 +38,13 @@ class Create { 'aws-python', ]; + const humanReadableTemplateList = `${validTemplates.slice(0, -1) + .join(', ')} and ${validTemplates.slice(-1)}`; + if (validTemplates.indexOf(this.options.template) === -1) { const errorMessage = [ `Template "${this.options.template}" is not supported.`, - ' Supported templates are: "aws-nodejs" and "aws-python".', + ` Supported templates are: ${humanReadableTemplateList}.`, ].join(''); throw new this.serverless.classes.Error(errorMessage); }