authorgravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-12-02 01:53:37 -08:00
committergravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-12-02 01:53:37 -08:00
log05df704ff8981166bb4df0e205f976c4ce30b54f
tree5e9a23db9658ed19793dbd6f0bcc9a0f065959f2
parenteb59312ee48e9029190c78dd9f890d197958dc82

init: change more pathy things to not assume unix


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

src/cmd_init.zig+2-2
......@@ -25,8 +25,8 @@ fn detect_pkgname(def: []const u8) ![]const u8 {
2525 if (def.len > 0) {
2626 return def;
2727 }
28 const dpath = try std.fs.realpathAlloc(gpa, "./");
29 const split = try u.split(dpath, "/");
28 const dpath = try std.fs.cwd().realpathAlloc(gpa, ".");
29 const split = try u.split(dpath, std.fs.path.sep_str);
3030 var name = split[split.len-1];
3131 name = u.trim_prefix(name, "zig-");
3232 u.assert(name.len > 0, "package name must not be an empty string", .{});