Merge pull request #205 from g-w1/make_sure_exists

Make sure zig exe exists
This commit is contained in:
Alexandros Naskos 2020-12-24 14:06:27 +02:00 committed by GitHub
commit d5aa1311ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1579,7 +1579,12 @@ pub fn main() anyerror!void {
if (config.zig_exe_path) |exe_path| { if (config.zig_exe_path) |exe_path| {
if (std.fs.path.isAbsolute(exe_path)) { if (std.fs.path.isAbsolute(exe_path)) {
zig_exe_path = try std.mem.dupe(allocator, u8, exe_path); zig_exe_path = try std.mem.dupe(allocator, u8, exe_path);
break :find_zig; // make sure the path still exists
if (blk: {
std.fs.cwd().access(zig_exe_path.?, .{}) catch break :blk false;
break :blk true;
})
break :find_zig;
} }
logger.debug("zig path `{}` is not absolute, will look in path", .{exe_path}); logger.debug("zig path `{}` is not absolute, will look in path", .{exe_path});