Skip to content

Commit 45ff4d4

Browse files
committed
yonk
1 parent ef70e9a commit 45ff4d4

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

src/main.zig

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub fn main() !void {
8181
defer if_free(allocator, needtofree_, zig_version);
8282

8383
const zig_binary = try try_get_bin: {
84-
var zig_binary_0 = try std.fs.path.join(allocator, &.{home, ".zigd", "versions", zig_version});
84+
var zig_binary_0 = try std.fs.path.join(allocator, &.{ home, ".zigd", "versions", zig_version });
8585
defer allocator.free(zig_binary_0);
8686
var zig_binary_1 = std.fs.openDirAbsolute(zig_binary_0, .{}) catch {
8787
std.debug.print("Did not find zig binary in zigd cache, installing...\n", .{});
@@ -103,14 +103,7 @@ fn exec(allocator: std.mem.Allocator, zig_binary: []const u8, args: [][:0]u8) !v
103103
defer nargs.deinit();
104104
try nargs.append(zig_binary);
105105

106-
var i: usize = 0;
107-
108-
for (args) |arg| {
109-
i += 1;
110-
111-
if (i == 1)
112-
continue;
113-
106+
for (args[1..]) |arg| {
114107
try nargs.append(arg);
115108
}
116109

src/utils.zig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
const std = @import("std");
22

3-
pub fn run(allocator: std.mem.Allocator, argv: []const []const u8) !std.ChildProcess.Term {
3+
pub fn run(allocator: std.mem.Allocator, argv: []const []const u8) !void {
44
var proc = std.ChildProcess.init(argv, allocator);
5-
return proc.spawnAndWait();
5+
try proc.spawn();
6+
_ = try proc.wait();
67
}
78

89
pub fn fromHome(home: []const u8, to: []const u8) !std.fs.Dir {

0 commit comments

Comments
 (0)