Compare commits

...

4 Commits

Author SHA1 Message Date
Meghan Denny
577459e01c Merge branch 'main' into nektro-patch-51017 2025-01-17 22:26:50 -08:00
Meghan Denny
933cc27fc7 Merge branch 'main' into nektro-patch-51017 2024-12-03 13:50:38 -08:00
Meghan Denny
8c0a738e70 Merge branch 'main' into nektro-patch-51017 2024-10-29 15:10:38 -07:00
Meghan Denny
d6282ce5c6 pm: error when removing package that does not exist 2024-10-28 16:32:39 -07:00
2 changed files with 7 additions and 2 deletions

View File

@@ -10839,6 +10839,11 @@ pub const PackageManager = struct {
}
}
}
if (!any_changes) {
Output.prettyErrorln("\n", .{});
Output.errGeneric("package \"{s}\" was not found in package.json, there's nothing to remove!", .{request.name});
Global.exit(1);
}
}
},

View File

@@ -157,7 +157,7 @@ it("should remove existing package", async () => {
);
});
it("should not reject missing package", async () => {
it("should reject missing package", async () => {
await writeFile(
join(package_dir, "package.json"),
JSON.stringify({
@@ -191,7 +191,7 @@ it("should not reject missing package", async () => {
stderr: "pipe",
env,
});
expect(await rmExited).toBe(0);
expect(await rmExited).toBe(1);
});
it("should not affect if package is not installed", async () => {