stop .zig-cache from breaking filenames

This commit is contained in:
Hamcha 2024-06-07 16:09:21 +02:00
parent f706fe6053
commit 41b133b930
Signed by: hamcha
GPG key ID: 1669C533B8CF6D89

View file

@ -70,7 +70,7 @@ fn make(step: *std.Build.Step, _: std.Progress.Node) !void {
}
fn calculateOutputName(b: *std.Build, path: []const u8) []const u8 {
const extIndex = std.mem.lastIndexOfScalar(u8, path, '.');
const extIndex = std.mem.lastIndexOfScalar(u8, std.fs.path.basename(path), '.');
const filenameWithoutExtension = if (extIndex) |index| path[0..index] else path;
return b.fmt("{s}.dol", .{filenameWithoutExtension});
}