authorgravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-12-28 19:20:17 -08:00
committergravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-12-28 19:20:17 -08:00
logeb51846d3ea24cc4821aef12952cfdfe54b6a191
tree71d58739c0ab47bbb54d4c70af7bdee40a46ff0c
parent79462250252016b0e3128c3c10056b0e394a8253

fix error that was arising on windows, fixes #7


1 files changed, 2 insertions(+), 0 deletions(-)

src/util/funcs.zig+2
......@@ -49,6 +49,7 @@ pub fn trim_prefix(in: []const u8, prefix: []const u8) []const u8 {
4949pub fn does_file_exist(fpath: []const u8) !bool {
5050 const file = std.fs.cwd().openFile(fpath, .{}) catch |e| switch (e) {
5151 error.FileNotFound => return false,
52 error.IsDir => return true,
5253 else => return e,
5354 };
5455 defer file.close();
......@@ -58,6 +59,7 @@ pub fn does_file_exist(fpath: []const u8) !bool {
5859pub fn does_folder_exist(fpath: []const u8) !bool {
5960 const file = std.fs.cwd().openFile(fpath, .{}) catch |e| switch (e) {
6061 error.FileNotFound => return false,
62 error.IsDir => return true,
6163 else => return e,
6264 };
6365 defer file.close();