File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,10 +13,23 @@ function initNodeEnv(command: string | undefined) {
1313 }
1414}
1515
16+ function showGreeting ( ) {
17+ // Ensure consistent spacing before the greeting message.
18+ // Different package managers handle output formatting differently - some automatically
19+ // add a blank line before command output, while others do not.
20+ const { npm_execpath, npm_lifecycle_event, NODE_RUN_SCRIPT_NAME } = process . env ;
21+ const isNpx = npm_lifecycle_event === 'npx' ;
22+ const isBun = npm_execpath ?. includes ( '.bun' ) ;
23+ const isNodeRun = Boolean ( NODE_RUN_SCRIPT_NAME ) ;
24+ const prefix = isNpx || isBun || isNodeRun ? '\n' : '' ;
25+ logger . greet ( `${ prefix } Rstack v${ RSTACK_VERSION } \n` ) ;
26+ }
27+
1628export function runCLI ( ) : void {
1729 const command = argv [ 2 ] ;
1830
1931 initNodeEnv ( command ) ;
32+ showGreeting ( ) ;
2033
2134 try {
2235 setupCommands ( ) ;
You can’t perform that action at this time.
0 commit comments