File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,6 @@ async function init() {
83
83
const unscopedPackageName = scopedPackageName . replace ( / .* \/ / , '' )
84
84
const shortUnscopedPackageName = unscopedPackageName . replace ( / ^ v u e - / , '' )
85
85
const projectName = unscopedPackageName . replace ( / - + / g, ' ' ) . trim ( ) . split ( ' ' ) . map ( s => s [ 0 ] . toUpperCase ( ) + s . slice ( 1 ) ) . join ( ' ' )
86
- const globalVariableName = projectName . replace ( / / g, '' )
87
86
88
87
const targetDirName = await textPrompt ( 'Target directory' , unscopedPackageName )
89
88
@@ -112,6 +111,13 @@ async function init() {
112
111
process . exit ( 1 )
113
112
}
114
113
114
+ const globalVariableName = await textPrompt ( 'Global variable name' , projectName . replace ( / / g, '' ) )
115
+
116
+ if ( ! / ^ [ a - z A - Z $ _ ] [ \w $ ] * $ / . test ( globalVariableName ) ) {
117
+ console . log ( 'Invalid variable name: ' + globalVariableName )
118
+ process . exit ( 1 )
119
+ }
120
+
115
121
const githubPath = await textPrompt ( 'GitHub path, e.g. skirtles-code/test-project (optional)' )
116
122
117
123
if ( githubPath && ! / ^ [ \w - ] + \/ [ \w - ] + $ / . test ( githubPath ) ) {
You can’t perform that action at this time.
0 commit comments