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() {
8383 const unscopedPackageName = scopedPackageName . replace ( / .* \/ / , '' )
8484 const shortUnscopedPackageName = unscopedPackageName . replace ( / ^ v u e - / , '' )
8585 const projectName = unscopedPackageName . replace ( / - + / g, ' ' ) . trim ( ) . split ( ' ' ) . map ( s => s [ 0 ] . toUpperCase ( ) + s . slice ( 1 ) ) . join ( ' ' )
86- const globalVariableName = projectName . replace ( / / g, '' )
8786
8887 const targetDirName = await textPrompt ( 'Target directory' , unscopedPackageName )
8988
@@ -112,6 +111,13 @@ async function init() {
112111 process . exit ( 1 )
113112 }
114113
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+
115121 const githubPath = await textPrompt ( 'GitHub path, e.g. skirtles-code/test-project (optional)' )
116122
117123 if ( githubPath && ! / ^ [ \w - ] + \/ [ \w - ] + $ / . test ( githubPath ) ) {
You can’t perform that action at this time.
0 commit comments