Merge pull request #198 from aniljava/master
build config incorrectly pulls folder named zig if it appears in PATH variable before zig executable
This commit is contained in:
commit
bdcd2a1e85
@ -34,6 +34,12 @@ pub fn config(step: *std.build.Step) anyerror!void {
|
||||
});
|
||||
defer allocator.free(full_path);
|
||||
|
||||
// Skip folders named zig
|
||||
const file = std.fs.openFileAbsolute(full_path, .{}) catch continue;
|
||||
const stat = file.stat() catch continue;
|
||||
const is_dir = stat.kind == .Directory;
|
||||
if (is_dir) continue;
|
||||
|
||||
var buf: [std.fs.MAX_PATH_BYTES]u8 = undefined;
|
||||
zig_exe_path = try std.mem.dupe(allocator, u8, std.os.realpath(full_path, &buf) catch continue);
|
||||
break :find_zig;
|
||||
|
Loading…
Reference in New Issue
Block a user