| ... | @@ -41,7 +41,10 @@ pub fn trim_prefix(in: []const u8, prefix: []const u8) []const u8 { | ... | @@ -41,7 +41,10 @@ pub fn trim_prefix(in: []const u8, prefix: []const u8) []const u8 { |
| 41 | } | 41 | } |
| 42 | | 42 | |
| 43 | pub fn does_file_exist(fpath: []const u8) !bool { | 43 | pub fn does_file_exist(fpath: []const u8) !bool { |
| 44 | const abs_path = try std.fs.realpathAlloc(gpa, fpath); | 44 | const abs_path = std.fs.realpathAlloc(gpa, fpath) catch |e| switch (e) { |
| | 45 | error.FileNotFound => return false, |
| | 46 | else => return e, |
| | 47 | }; |
| 45 | const file = std.fs.openFileAbsolute(abs_path, .{}) catch |e| switch (e) { | 48 | const file = std.fs.openFileAbsolute(abs_path, .{}) catch |e| switch (e) { |
| 46 | error.FileNotFound => return false, | 49 | error.FileNotFound => return false, |
| 47 | else => return e, | 50 | else => return e, |