diff options
author | 2023-09-19 03:58:55 -0700 | |
---|---|---|
committer | 2023-09-19 03:58:55 -0700 | |
commit | 4b5dcc8a6a77980e16dd48bd52821918d140700c (patch) | |
tree | 2a84c013e2dafe73a1d50e979ce37071d6aaa8d5 /src | |
parent | d2328285f952537603fa2cbcdef44fde50c69b82 (diff) | |
download | bun-4b5dcc8a6a77980e16dd48bd52821918d140700c.tar.gz bun-4b5dcc8a6a77980e16dd48bd52821918d140700c.tar.zst bun-4b5dcc8a6a77980e16dd48bd52821918d140700c.zip |
Make bun install --verbose more verbose (#5726)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/http_client_async.zig | 8 | ||||
-rw-r--r-- | src/install/install.zig | 7 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/http_client_async.zig b/src/http_client_async.zig index b3c06df56..a78358066 100644 --- a/src/http_client_async.zig +++ b/src/http_client_async.zig @@ -2289,10 +2289,6 @@ pub fn onWritable(this: *HTTPClient, comptime is_first_call: bool, comptime is_s }; } - if (this.verbose) { - printRequest(request); - } - const headers_len = list.items.len; std.debug.assert(list.items.len == writer.context.items.len); if (this.state.request_body.len > 0 and list.capacity - list.items.len > 0 and !this.proxy_tunneling) { @@ -2327,6 +2323,10 @@ pub fn onWritable(this: *HTTPClient, comptime is_first_call: bool, comptime is_s this.state.request_sent_len += @as(usize, @intCast(amount)); const has_sent_headers = this.state.request_sent_len >= headers_len; + if (has_sent_headers and this.verbose) { + printRequest(request); + } + if (has_sent_headers and this.state.request_body.len > 0) { this.state.request_body = this.state.request_body[this.state.request_sent_len - headers_len ..]; } diff --git a/src/install/install.zig b/src/install/install.zig index 158130b25..c7a2816a5 100644 --- a/src/install/install.zig +++ b/src/install/install.zig @@ -358,6 +358,10 @@ const NetworkTask = struct { ); this.http.client.reject_unauthorized = this.package_manager.tlsRejectUnauthorized(); + if (PackageManager.verbose_install) { + this.http.client.verbose = true; + } + this.callback = .{ .package_manifest = .{ .name = try strings.StringOrTinyString.initAppendIfNeeded(name, *FileSystem.FilenameStore, &FileSystem.FilenameStore.instance), @@ -437,6 +441,9 @@ const NetworkTask = struct { null, ); this.http.client.reject_unauthorized = this.package_manager.tlsRejectUnauthorized(); + if (PackageManager.verbose_install) { + this.http.client.verbose = true; + } this.callback = .{ .extract = tarball }; } |