Skip to content

Commit

Permalink
Fix ensure path on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
delasy committed Jan 7, 2024
1 parent edd2320 commit 796c029
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 796c029

Please sign in to comment.