File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import {
1010 select ,
1111 text ,
1212} from '@clack/prompts' ;
13+ import { determineAgent } from '@vercel/detect-agent' ;
1314import spawn from 'cross-spawn' ;
1415import deepmerge from 'deepmerge' ;
1516import minimist from 'minimist' ;
@@ -105,9 +106,7 @@ function logHelpMessage(
105106 extraTools ?: ExtraTool [ ] ,
106107) {
107108 const extraToolNames = extraTools ?. map ( ( tool ) => tool . value ) ?? [ ] ;
108- const toolsList = [ ...BUILTIN_TOOLS , ...extraToolNames ] . join (
109- ', ' ,
110- ) ;
109+ const toolsList = [ ...BUILTIN_TOOLS , ...extraToolNames ] . join ( ', ' ) ;
111110
112111 logger . log ( `
113112 Usage: create-${ name } [dir] [options]
@@ -273,8 +272,15 @@ export async function create({
273272 */
274273 argv ?: string [ ] ;
275274} ) {
276- console . log ( '' ) ;
277- logger . greet ( `◆ Create ${ upperFirst ( name ) } Project` ) ;
275+ logger . greet ( `\n◆ Create ${ upperFirst ( name ) } Project` ) ;
276+
277+ const { isAgent } = await determineAgent ( ) ;
278+ if ( isAgent ) {
279+ console . log ( '' ) ;
280+ logger . info (
281+ 'To create a project non-interactively, run: npx -y create-rsbuild <DIR> --template <TEMPLATE>' ,
282+ ) ;
283+ }
278284
279285 const argv = parseArgv ( processArgv ) ;
280286
You can’t perform that action at this time.
0 commit comments