This commit is contained in:
Alistair Smith
2025-08-20 15:22:11 -07:00
parent 35888fa2b2
commit 562197f804
2 changed files with 18 additions and 14 deletions

View File

@@ -400,8 +400,10 @@ pub fn print(
.none, .dir => {
printed_installed_update_request = true;
const was_updated = manager.updating_packages.contains(package_name);
const action_word = if (was_updated) "updated" else "installed";
const action_word = if (manager.subcommand == .update)
(if (manager.updating_packages.contains(package_name)) "updated" else "added")
else
"installed";
const fmt = comptime Output.prettyFmt("<r><green>{s}<r> <b>{s}<r><d>@{}<r>\n", enable_ansi_colors);
@@ -425,8 +427,10 @@ pub fn print(
};
{
const was_updated = manager.updating_packages.contains(package_name);
const action_word = if (was_updated) "updated" else "installed";
const action_word = if (manager.subcommand == .update)
(if (manager.updating_packages.contains(package_name)) "updated" else "added")
else
"installed";
const fmt = comptime Output.prettyFmt("<r><green>{s}<r> {s}<r><d>@{}<r> with binaries:\n", enable_ansi_colors);

View File

@@ -5210,7 +5210,7 @@ describe("update", () => {
expect(out).toEqual([
expect.stringContaining("bun update v1."),
"",
"installed no-deps@1.0.1",
"updated no-deps@1.0.1",
"",
expect.stringContaining("done"),
"",
@@ -5230,7 +5230,7 @@ describe("update", () => {
expect(out).toEqual([
expect.stringContaining("bun update v1."),
"",
"installed no-deps@2.0.0",
"updated no-deps@2.0.0",
"",
"1 package installed",
]);
@@ -5570,10 +5570,10 @@ describe("update", () => {
expect(out).toEqual([
expect.stringContaining("bun update v1."),
"",
"installed what-bin@1.5.0 with binaries:",
"updated what-bin@1.5.0 with binaries:",
" - what-bin",
"installed uses-what-bin@1.5.0",
"installed a-dep@1.0.5",
"updated uses-what-bin@1.5.0",
"updated a-dep@1.0.5",
"",
"3 packages installed",
]);
@@ -5617,7 +5617,7 @@ describe("update", () => {
expect(out).toEqual([
expect.stringContaining("bun update v1."),
"",
"installed a-dep@1.0.10",
"updated a-dep@1.0.10",
"",
expect.stringMatching(/(\[\d+\.\d+m?s\])/),
"",
@@ -5663,7 +5663,7 @@ describe("update", () => {
expect(out).toEqual([
expect.stringContaining("bun update v1."),
"",
args ? "installed a-dep@1.0.10" : expect.stringContaining("+ a-dep@1.0.10"),
args ? "updated a-dep@1.0.10" : expect.stringContaining("+ a-dep@1.0.10"),
"",
"1 package installed",
]);
@@ -5733,7 +5733,7 @@ describe("update", () => {
expect(out).toEqual([
expect.stringContaining("bun update v1."),
"",
"installed no-deps@1.0.0",
"updated no-deps@1.0.0",
"",
expect.stringMatching(/(\[\d+\.\d+m?s\])/),
"",
@@ -5749,7 +5749,7 @@ describe("update", () => {
expect(out).toEqual([
expect.stringContaining("bun update v1."),
"",
"installed no-deps@2.0.0",
"added no-deps@2.0.0",
"",
"1 package installed",
]);
@@ -5783,7 +5783,7 @@ describe("update", () => {
expect(out).toEqual([
expect.stringContaining("bun update v1."),
"",
"installed no-deps@1.1.0",
"updated no-deps@1.1.0",
"",
"1 package installed",
]);