| ... | @@ -26,6 +26,7 @@ fn detect_pkgname(def: []const u8) ![]const u8 { | ... | @@ -26,6 +26,7 @@ fn detect_pkgname(def: []const u8) ![]const u8 { |
| 26 | if (def.len > 0) { | 26 | if (def.len > 0) { |
| 27 | return def; | 27 | return def; |
| 28 | } | 28 | } |
| | 29 | u.assert(try u.does_file_exist("build.zig"), "init requires a build.zig file", .{}); |
| 29 | const dpath = try std.fs.cwd().realpathAlloc(gpa, "build.zig"); | 30 | const dpath = try std.fs.cwd().realpathAlloc(gpa, "build.zig"); |
| 30 | const split = try u.split(dpath, std.fs.path.sep_str); | 31 | const split = try u.split(dpath, std.fs.path.sep_str); |
| 31 | var name = split[split.len - 2]; | 32 | var name = split[split.len - 2]; |