fixed bug where it was not supported for Windows

This commit is contained in:
2026-05-22 19:47:08 +02:00
parent ff13a82ac2
commit 07b13e2be7
2 changed files with 3 additions and 4 deletions
+1 -3
View File
@@ -11,11 +11,9 @@ pub fn build(b: *std.Build) void {
const exe = b.addExecutable(.{ const exe = b.addExecutable(.{
.name = "file_organizer", .name = "file_organizer",
.root_module = b.createModule(.{ .root_module = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = target, .target = target,
.optimize = optimize, .optimize = optimize,
.imports = &.{
.{ .name = "file_organizer", .module = mod },
},
}), }),
}); });
+2 -1
View File
@@ -19,6 +19,7 @@ fn placeFile(io: std.Io, dir: std.Io.Dir, category: classify.Category, name: []c
try dir.createDirPath(io, dest); try dir.createDirPath(io, dest);
var buf: [std.fs.max_path_bytes]u8 = undefined; var buf: [std.fs.max_path_bytes]u8 = undefined;
const path = try std.fmt.bufPrint(&buf, "{s}/{s}", .{ dest, name }); var fba = std.heap.FixedBufferAllocator.init(&buf);
const path = try std.fs.path.join(fba.allocator(), &.{ dest, name });
try dir.rename(name, dir, path, io); try dir.rename(name, dir, path, io);
} }