| ... | ... | @@ -45,11 +45,7 @@ pub fn trim_prefix(in: []const u8, prefix: []const u8) []const u8 { |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | pub fn does_file_exist(fpath: []const u8) !bool { |
| 48 | | const abs_path = std.fs.realpathAlloc(gpa, fpath) catch |e| switch (e) { |
| 49 | | error.FileNotFound => return false, |
| 50 | | else => return e, |
| 51 | | }; |
| 52 | | const file = std.fs.openFileAbsolute(abs_path, .{}) catch |e| switch (e) { |
| 48 | const file = std.fs.cwd().openFile(fpath, .{}) catch |e| switch (e) { |
| 53 | 49 | error.FileNotFound => return false, |
| 54 | 50 | else => return e, |
| 55 | 51 | }; |
| ... | ... | @@ -58,11 +54,10 @@ pub fn does_file_exist(fpath: []const u8) !bool { |
| 58 | 54 | } |
| 59 | 55 | |
| 60 | 56 | pub fn does_folder_exist(fpath: []const u8) !bool { |
| 61 | | const abs_path = std.fs.realpathAlloc(gpa, fpath) catch |e| switch (e) { |
| 57 | const file = try std.fs.cwd().openFile(abs_path, .{}) catch |e| switch (e) { |
| 62 | 58 | error.FileNotFound => return false, |
| 63 | 59 | else => return e, |
| 64 | 60 | }; |
| 65 | | const file = try std.fs.openFileAbsolute(abs_path, .{}); |
| 66 | 61 | defer file.close(); |
| 67 | 62 | const s = try file.stat(); |
| 68 | 63 | if (s.kind != .Directory) { |