aboutsummaryrefslogtreecommitdiff
path: root/src/install/install.zig
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-01-04 04:00:26 -0800
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-01-04 04:00:26 -0800
commit3cf0689d46babcb25c98a023ccdb1f302d6de868 (patch)
treed3376e27a9bad2211fc532c15fd91d7fdb4b9f0d /src/install/install.zig
parent623f77e0973085bf7a7eea34278679cf751b964b (diff)
downloadbun-3cf0689d46babcb25c98a023ccdb1f302d6de868.tar.gz
bun-3cf0689d46babcb25c98a023ccdb1f302d6de868.tar.zst
bun-3cf0689d46babcb25c98a023ccdb1f302d6de868.zip
[bun install] Fix more cases where bytes are printed instead of strings
Diffstat (limited to '')
-rw-r--r--src/install/install.zig48
1 files changed, 38 insertions, 10 deletions
diff --git a/src/install/install.zig b/src/install/install.zig
index cdac2ad0a..d30bc22bc 100644
--- a/src/install/install.zig
+++ b/src/install/install.zig
@@ -4529,12 +4529,20 @@ pub const PackageManager = struct {
has_updated_this_run = true;
}
}
+
const response = task.http.response orelse {
if (comptime log_level != .silent) {
- Output.prettyErrorln("Failed to download package manifest for package {s}", .{
- name.slice(),
- });
- Output.flush();
+ const fmt = "<r><red>rerror<r>: Failed to download package manifest <b>{s}<r>";
+ const args = .{name.slice()};
+ if (comptime log_level.showProgress()) {
+ Output.prettyWithPrinterFn(fmt, args, Progress.log, &manager.progress);
+ } else {
+ Output.prettyErrorln(
+ fmt,
+ args,
+ );
+ Output.flush();
+ }
}
continue;
};
@@ -4674,8 +4682,17 @@ pub const PackageManager = struct {
.package_manifest => {
if (task.status == .fail) {
if (comptime log_level != .silent) {
- Output.prettyErrorln("Failed to parse package manifest for {s}", .{task.request.package_manifest.name.slice()});
- Output.flush();
+ const fmt = "<r><red>rerror<r>: Failed to parse package manifest for <b>{s}<r>";
+ const args = .{task.request.package_manifest.name.slice()};
+ if (comptime log_level.showProgress()) {
+ Output.prettyWithPrinterFn(fmt, args, Progress.log, &manager.progress);
+ } else {
+ Output.prettyErrorln(
+ fmt,
+ args,
+ );
+ Output.flush();
+ }
}
continue;
}
@@ -4710,10 +4727,21 @@ pub const PackageManager = struct {
},
.extract => {
if (task.status == .fail) {
- Output.prettyErrorln("Failed to extract tarball for {s}", .{
- task.request.extract.tarball.name,
- });
- Output.flush();
+ if (comptime log_level != .silent) {
+ const fmt = "<r><red>rerror<r>: Failed to extract tarball for <b>{s}<r>";
+ const args = .{
+ task.request.extract.tarball.name.slice(),
+ };
+ if (comptime log_level.showProgress()) {
+ Output.prettyWithPrinterFn(fmt, args, Progress.log, &manager.progress);
+ } else {
+ Output.prettyErrorln(
+ fmt,
+ args,
+ );
+ Output.flush();
+ }
+ }
continue;
}
const package_id = task.request.extract.tarball.package_id;