Require application name to have at least 4 characters

We get a weird error message from pine otherwise:

	ResinRequestError: Request error: It is necessary that each app name
	that is of a user (Auth), has a Length (Type) that is greater than or
	equal to 4.
This commit is contained in:
Juan Cruz Viotti 2015-10-19 10:56:02 -04:00
parent b6ebd0631a
commit 0b7e2a2c8c
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) ->