From 796c029b5c94053f5892a9e0e1ec4ecec3a4ad96 Mon Sep 17 00:00:00 2001 From: Aaron Delasy Date: Sun, 7 Jan 2024 15:14:06 +0200 Subject: [PATCH] Fix ensure path on Windows --- src/utils | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils b/src/utils index 146c561..d20f98d 100644 --- a/src/utils +++ b/src/utils @@ -10,10 +10,11 @@ export fn chmodAddSync (path: str, mode: int) { } export fn ensurePathDirectory (path: str) { + isWin := os_NAME == "Windows" paths := path_dirname(path).split(path_SEP) - mut currentPath := path_SEP + mut currentPath := (isWin ? paths[0] : "") + path_SEP - loop i := 0; i < paths.len; i++ { + loop i := isWin ? 1 : 0; i < paths.len; i++ { p := paths[i] as str if p.empty { continue } currentPath += p + path_SEP