Skip to content

Commit cea08f1

Browse files
authored
fix(cli): ensure consistent spacing for node run script (#5813)
1 parent bcfa7fd commit cea08f1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/core/src/cli/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ function showGreeting() {
2323
// Ensure consistent spacing before the greeting message.
2424
// Different package managers handle output formatting differently - some automatically
2525
// add a blank line before command output, while others do not.
26-
const { npm_execpath, npm_lifecycle_event } = process.env;
26+
const { npm_execpath, npm_lifecycle_event, NODE_RUN_SCRIPT_NAME } =
27+
process.env;
2728
const isNpx = npm_lifecycle_event === 'npx';
2829
const isBun = npm_execpath?.includes('.bun');
29-
const prefix = isNpx || isBun ? '\n' : '';
30+
const isNodeRun = Boolean(NODE_RUN_SCRIPT_NAME);
31+
const prefix = isNpx || isBun || isNodeRun ? '\n' : '';
3032
logger.greet(`${prefix} Rsbuild v${RSBUILD_VERSION}\n`);
3133
}
3234

0 commit comments

Comments
 (0)