authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-03-20 12:02:08 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-03-20 12:02:08 -07:00
log53b62b9f0adf6c726e23fcce530aeb333b232467
tree115b0348ad9a54edef3116c52c1c089540bf04e4
parent9835f8cfcab1ca2a33a9be0586c5ac44de3d6da3

util/run_cmd- increase max output bytes and free when done running


1 files changed, 3 insertions(+), 1 deletions(-)

src/util/funcs.zig+3-1
...@@ -158,13 +158,15 @@ pub fn file_list(dpath: []const u8, list: *std.ArrayList([]const u8)) !void {...@@ -158,13 +158,15 @@ pub fn file_list(dpath: []const u8, list: *std.ArrayList([]const u8)) !void {
158}158}
159159
160pub fn run_cmd(dir: ?[]const u8, args: []const []const u8) !u32 {160pub fn run_cmd(dir: ?[]const u8, args: []const []const u8) !u32 {
161 const result = std.ChildProcess.exec(.{ .allocator = gpa, .cwd = dir, .argv = args, }) catch |e| switch(e) {161 const result = std.ChildProcess.exec(.{ .allocator = gpa, .cwd = dir, .argv = args, .max_output_bytes = std.math.maxInt(usize) }) catch |e| switch(e) {
162 error.FileNotFound => {162 error.FileNotFound => {
163 u.assert(false, "\"{s}\" command not found", .{args[0]});163 u.assert(false, "\"{s}\" command not found", .{args[0]});
164 unreachable;164 unreachable;
165 },165 },
166 else => return e,166 else => return e,
167 };167 };
168 gpa.free(result.stdout);
169 gpa.free(result.stderr);
168 return result.term.Exited;170 return result.term.Exited;
169}171}
170172