Skip to content

Commit

Permalink
fix(cli/install): --silent disables summary (#16321)
Browse files Browse the repository at this point in the history
Co-authored-by: Dylan Conway <[email protected]>
Co-authored-by: Michael H <[email protected]>
  • Loading branch information
3 people authored Jan 13, 2025
1 parent 19bdd5a commit edeaab1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/install/install.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
19 changes: 19 additions & 0 deletions test/cli/install/bun-install-registry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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", () => {
Expand Down

0 comments on commit edeaab1

Please sign in to comment.