@@ -17,8 +17,10 @@ const {
17
17
const isTTY = require ( `./util/is-tty` )
18
18
const spawn = ( cmd : string , options : any ) => {
19
19
const [ file , ...args ] = cmd . split ( / \s + / )
20
- return execa ( file , args , { stdio : `inherit` , ... options } )
20
+ return spawnWithArgs ( file , args , options )
21
21
}
22
+ const spawnWithArgs = ( file : string , args : string [ ] , options : any ) =>
23
+ execa ( file , args , { stdio : `inherit` , ...options } )
22
24
23
25
// Checks the existence of yarn package and user preference if it exists
24
26
// We use yarnpkg instead of yarn to avoid conflict with Hadoop yarn
@@ -152,11 +154,15 @@ const clone = async (hostInfo: any, rootPath: string) => {
152
154
url = hostInfo . https ( { noCommittish : true , noGitPlus : true } )
153
155
}
154
156
155
- const branch = hostInfo . committish ? `-b ${ hostInfo . committish } ` : ``
157
+ const branch = hostInfo . committish ? [ `-b` , ` hostInfo.committish` ] : [ `` ]
156
158
157
159
report . info ( `Creating new site from git: ${ url } ` )
158
160
159
- await spawn ( `git clone ${ branch } ${ url } ${ rootPath } --single-branch` )
161
+ const args = [ `clone` , ...branch , url , rootPath , `--single-branch` ] . filter (
162
+ arg => Boolean ( arg )
163
+ )
164
+
165
+ await spawnWithArgs ( `git` , args )
160
166
161
167
report . success ( `Created starter directory layout` )
162
168
0 commit comments