Explorar o código

application name validation

Manfred Kroehnert %!s(int64=11) %!d(string=hai) anos
pai
achega
1b234a63f8
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      template.js

+ 2 - 0
template.js

@@ -24,6 +24,8 @@ exports.warnOn = '*';
 
 // The actual init template.
 exports.template = function(grunt, init, done) {
+  init.prompts.name.validator= /^[A-Z][A-Za-z0-9]*$/;
+  init.prompts.name.warning= 'Must be a valid class name: only alphanumeric and starting with an uppercase letter!';
 
   init.process({type: 'amber'}, [
     // Prompt for these values.