Sfoglia il codice sorgente

application name validation

Manfred Kroehnert 11 anni fa
parent
commit
1b234a63f8
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  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.