fix(cli/install): --silent disables summary (#16321)

Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Co-authored-by: Michael H <git@riskymh.dev>
This commit is contained in:
Don Isaac
2025-01-12 20:06:10 -08:00
committed by GitHub
parent 19bdd5a56c
commit edeaab1cf2
2 changed files with 20 additions and 1 deletions

View File

@@ -7567,7 +7567,7 @@ pub const PackageManager = struct {
this.do.save_lockfile = false;
}
if (cli.no_summary) {
if (cli.no_summary or cli.silent) {
this.do.summary = false;
}

View File

@@ -1970,6 +1970,25 @@ test("--lockfile-only", async () => {
expect((await Bun.file(join(packageDir, "bun.lock")).text()).replaceAll(/localhost:\d+/g, "localhost:1234")).toBe(
firstLockfile,
);
// --silent works
const {
stdout,
stderr,
exited: exited2,
} = spawn({
cmd: [bunExe(), "install", "--lockfile-only", "--silent"],
cwd: packageDir,
stdout: "pipe",
stderr: "pipe",
env,
});
expect(await exited2).toBe(0);
const out = await Bun.readableStreamToText(stdout);
const err = await Bun.readableStreamToText(stderr);
expect(out).toBe("");
expect(err).toBe("");
});
describe("bundledDependencies", () => {