From e708629265ebd6edac34604ca8ba6ffe535f2da6 Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Mon, 5 Feb 2024 18:38:39 -0800 Subject: [PATCH] Update subproc.zig --- src/shell/subproc.zig | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/src/shell/subproc.zig b/src/shell/subproc.zig index 4dd632e8b3..ad426994c4 100644 --- a/src/shell/subproc.zig +++ b/src/shell/subproc.zig @@ -276,27 +276,6 @@ pub fn NewShellSubprocess(comptime EventLoopKind: JSC.EventLoopKind, comptime Sh } } - pub const Pipe = union(enum) { - stream: JSC.WebCore.ReadableStream, - buffer: BufferedOutput, - - pub fn finish(this: *@This()) void { - if (this.* == .stream and this.stream.ptr == .File) { - // this.stream.ptr.File.deref(); - } - } - - pub fn done(this: *@This()) void { - if (this.* == .stream) { - // if (this.stream.ptr == .File) this.stream.ptr.File. - this.stream.done(); - return; - } - - this.buffer.close(); - } - }; - pub fn init(subproc: *Subprocess, comptime kind: OutKind, stdio: Stdio, fd: ?bun.FileDescriptor, allocator: std.mem.Allocator, max_size: u32) Readable { return switch (stdio) { .ignore => Readable{ .ignore = {} }, @@ -872,7 +851,7 @@ pub fn NewShellSubprocess(comptime EventLoopKind: JSC.EventLoopKind, comptime Sh .cwd = GlobalHandle.init(jsc_vm).topLevelDir(), .stdio = .{ .{ .ignore = {} }, - .{ .pipe = null }, + .{ .pipe = {} }, .{ .inherit = .{} }, }, .lazy = false, @@ -884,8 +863,8 @@ pub fn NewShellSubprocess(comptime EventLoopKind: JSC.EventLoopKind, comptime Sh }; if (comptime is_sync) { - out.stdio[1] = .{ .pipe = null }; - out.stdio[2] = .{ .pipe = null }; + out.stdio[1] = .{ .pipe = {} }; + out.stdio[2] = .{ .pipe = {} }; } return out; }