fix(cli): correct --dry-run help text for bun publish (#25137)

## Summary
- Fix `bun publish --help` showing incorrect `--dry-run` description
("Don't install anything" → "Perform a dry run without making changes")
- The `--dry-run` flag is in a shared params array used by multiple
commands, so the new generic message works for all of them

Fixes #24806

## Test plan
- [x] Verify `bun publish --help` shows "Perform a dry run without
making changes" for --dry-run
- [x] Regression test added that validates the correct help text is
shown
- [x] Test passes with debug build, fails with system bun (validating it
tests the right thing)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
robobun
2025-11-27 18:12:07 -08:00
committed by GitHub
parent a83fceafc7
commit bab583497c
2 changed files with 24 additions and 1 deletions

View File

@@ -0,0 +1,23 @@
import { expect, test } from "bun:test";
import { bunEnv, bunExe } from "harness";
test("bun publish --help shows correct message for --dry-run", async () => {
await using proc = Bun.spawn({
cmd: [bunExe(), "publish", "--help"],
env: bunEnv,
stdout: "pipe",
stderr: "pipe",
});
const [stdout, stderr, exitCode] = await Promise.all([proc.stdout.text(), proc.stderr.text(), proc.exited]);
// The --dry-run flag should have a generic description that works for all commands
// It should NOT say "Don't install anything" when used with "bun publish"
expect(stdout).toContain("--dry-run");
expect(stdout).toContain("Perform a dry run without making changes");
// Make sure it doesn't contain the old incorrect message
expect(stdout).not.toContain("Don't install anything");
expect(exitCode).toBe(0);
});