mirror of
https://git.aramjonghu.nl/AramJonghu/file-organizer.git
synced 2026-06-06 17:48:23 +02:00
fixed bug where it was not supported for Windows
This commit is contained in:
@@ -11,11 +11,9 @@ pub fn build(b: *std.Build) void {
|
||||
const exe = b.addExecutable(.{
|
||||
.name = "file_organizer",
|
||||
.root_module = b.createModule(.{
|
||||
.root_source_file = b.path("src/main.zig"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
.imports = &.{
|
||||
.{ .name = "file_organizer", .module = mod },
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
|
||||
+2
-1
@@ -19,6 +19,7 @@ fn placeFile(io: std.Io, dir: std.Io.Dir, category: classify.Category, name: []c
|
||||
try dir.createDirPath(io, dest);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user