mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-08-03 19:28:49 -04:00
Made the open folder button work on windows (#586)
* Changed the saveFolder function so that it does the correct command on windows * Changed the saveFolder function so that it does the correct command on windows * why
This commit is contained in:
parent
60b17ed6ef
commit
5281b77e9e
@ -80,8 +80,10 @@ fn openFolder(namePtr: usize) void {
|
||||
const nullTerminatedName: [*:0]const u8 = @ptrFromInt(namePtr);
|
||||
const name = std.mem.span(nullTerminatedName);
|
||||
|
||||
const command = if(builtin.os.tag == .windows) .{"start", "explorer"} else .{"open"};
|
||||
const path = std.fmt.allocPrint(main.stackAllocator.allocator, "saves/{s}", .{name}) catch unreachable;
|
||||
const command = if(builtin.os.tag == .windows) .{"explorer"} else .{"open"};
|
||||
|
||||
const path_fmt = if (builtin.os.tag == .windows) "saves\\{s}" else "saves/{s}"; // Use backslashes on windows because it forces you to
|
||||
const path = std.fmt.allocPrint(main.stackAllocator.allocator, path_fmt, .{name}) catch unreachable;
|
||||
defer main.stackAllocator.free(path);
|
||||
const result = std.process.Child.run(.{
|
||||
.allocator = main.stackAllocator.allocator,
|
||||
|
Loading…
x
Reference in New Issue
Block a user