Skip to content
This repository was archived by the owner on Jul 15, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,21 @@ module.exports = yeoman.generators.Base.extend({
}, {
type: 'input',
name: 'tags',
message: 'Project tags (comma separated)'
message: 'Project tags (comma separated. Allowed characters are: a-z, 0-9, +, -, # and .)'
}];

this.prompt(prompts, function (props) {
var tags = props.tags || '';
this.props = props;
this.props.tags = tags.split(',');
let accTags = [];
this.props.tags.forEach(function (tag, index, tagsArray){
tagsArray[index] = tag.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
tag = tag.replace(/^\s\s*/, "").replace(/\s\s*$/, "");
if (/^[a-z0-9\+\.#-]*$/.test(tag) && tag != '') {
accTags.push(tag);
}
});
this.props.tags = accTags;
done();
}.bind(this));
},
Expand Down