You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 30, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: generators/app/index.js
+16-2Lines changed: 16 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -25,14 +25,28 @@ module.exports = class extends Generator {
25
25
type: "input",
26
26
name: "toolNameComputer",
27
27
message:
28
-
"Computer package name? This is a computer name with no capital letters or special characters apart from the - dash.",
28
+
"Computer package name? This is a computer name with NO capital letters or special characters apart from the hyphen ( - ) .",
29
+
validate: props=>{
30
+
if(props.match(/^[a-z0-9-]+$/)){
31
+
returntrue;
32
+
}
33
+
34
+
return"This is not a valid computer name for the project, you can use only small letters, number and hyphen. Enter again.";
35
+
},
29
36
default: "biojs-webcomponent-tool-name-here"
30
37
},
31
38
{
32
39
type: "input",
33
40
name: "toolNameHuman",
34
41
message:
35
-
'Thanks! Now, give me a human name for the project with only letters and NO special characters. e.g. "Genome Browser"',
42
+
'Thanks! Now, give me a human name for the project with only letters and NO special characters apart from the whitespace (space). e.g. "Genome Browser"',
43
+
validate: props=>{
44
+
if(props.match(/^[A-Za-z]+$/||/^[A-Za-z\s]+$/)){
45
+
returntrue;
46
+
}
47
+
48
+
return"This is not a valid human name for the project, you can use only letters and whitespace. Enter again.";
0 commit comments