File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ function required(s: string): string | true {
10
10
return true
11
11
}
12
12
13
+ // https://github.com/vitejs/vite/blob/76082e3d3033b09b02b6db64de6e36942593c753/packages/create-vite/src/index.ts#L557
13
14
function isValidPackageName ( projectName : string ) {
14
15
return / ^ (?: @ [ a - z \d \- * ~ ] [ a - z \d \- * . _ ~ ] * \/ ) ? [ a - z \d \- ~ ] [ a - z \d \- . _ ~ ] * $ / . test (
15
16
projectName ,
@@ -110,7 +111,11 @@ function installTreeSitterPackage(answer: Answers) {
110
111
}
111
112
112
113
async function main ( ) {
113
- const cwd = process . cwd ( )
114
+ let cwd = process . cwd ( )
115
+ if ( process . argv . length > 2 ) {
116
+ const targetDir = process . argv [ 2 ]
117
+ cwd = path . join ( cwd , targetDir )
118
+ }
114
119
const config = await askConfiguration ( )
115
120
await copyTemplate ( cwd , config . includeDotFiles )
116
121
await renameFiles ( cwd , config )
You can’t perform that action at this time.
0 commit comments