Merge pull request #232 from resin-io/jviotti/fix/app-create-validation

Require application name to have at least 4 characters
This commit is contained in:
Juan Cruz Viotti 2015-10-19 14:06:43 -04:00
commit f6d2043747
2 changed files with 12 additions and 1 deletions

View File

@ -80,7 +80,13 @@
}
return form.ask({
message: 'Choose a Name for your new application',
type: 'input'
type: 'input',
validate: function(input) {
if (input.length < 4) {
return 'The application name should be at least 4 characters';
}
return true;
}
});
});
};

View File

@ -53,6 +53,11 @@ exports.selectOrCreateApplication = ->
form.ask
message: 'Choose a Name for your new application'
type: 'input'
validate: (input) ->
if input.length < 4
return 'The application name should be at least 4 characters'
return true
exports.selectProjectDirectory = ->
resin.settings.get('projectsDirectory').then (projectsDirectory) ->