authorgravatar for meghan@unicycle.coMeghan Denny <meghan@unicycle.co> 2021-07-18 18:08:28 -07:00
committergravatar for meghan@unicycle.coMeghan Denny <meghan@unicycle.co> 2021-07-18 18:08:28 -07:00
log0e92b35ed0e0c237509207df1d6ca359fe866ee9
tree0564f936094a4e1252231582e8eac9e18ec1b3fb
parent51c7736bc1e0fcefe4c86059c176acf505ea5280

util- dont open an empty path since it will fail


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

src/util/funcs.zig+2-1
......@@ -269,7 +269,8 @@ pub fn detect_pkgname(override: []const u8, dir: []const u8) ![]const u8 {
269269 if (override.len > 0) {
270270 return override;
271271 }
272 if (!(try does_file_exist("build.zig", try std.fs.cwd().openDir(dir, .{})))) {
272 const dirO = if (dir.len == 0) std.fs.cwd() else try std.fs.cwd().openDir(dir, .{});
273 if (!(try does_file_exist("build.zig", dirO))) {
273274 return error.NoBuildZig;
274275 }
275276 const dpath = try std.fs.realpathAlloc(gpa, try std.mem.concat(gpa, u8, &.{ dir, "build.zig" }));