@@ -13,7 +13,10 @@ import {logger} from '@docusaurus/logger';
1313import execa from 'execa' ;
1414import prompts , { type Choice } from 'prompts' ;
1515import supportsColor from 'supports-color' ;
16- import { escapeShellArg , askPreferredLanguage } from '@docusaurus/utils' ;
16+
17+ // TODO remove dependency on large @docusaurus /utils
18+ // would be better to have a new smaller @docusaurus /utils-cli package
19+ import { askPreferredLanguage } from '@docusaurus/utils' ;
1720
1821type LanguagesOptions = {
1922 javascript ?: boolean ;
@@ -530,10 +533,7 @@ export default async function init(
530533
531534 if ( source . type === 'git' ) {
532535 const gitCommand = await getGitCommand ( source . strategy ) ;
533- const gitCloneCommand = `${ gitCommand } ${ escapeShellArg (
534- source . url ,
535- ) } ${ escapeShellArg ( dest ) } `;
536- if ( execa . command ( gitCloneCommand ) . exitCode !== 0 ) {
536+ if ( ( await execa ( gitCommand , [ source . url , dest ] ) ) . exitCode !== 0 ) {
537537 logger . error `Cloning Git template failed!` ;
538538 process . exit ( 1 ) ;
539539 }
@@ -598,8 +598,7 @@ export default async function init(
598598 {
599599 env : {
600600 ...process . env ,
601- // Force coloring the output, since the command is invoked by
602- // shelljs, which is not an interactive shell
601+ // Force coloring the output
603602 ...( supportsColor . stdout ? { FORCE_COLOR : '1' } : { } ) ,
604603 } ,
605604 } ,
0 commit comments