Skip to content

Commit

Permalink
Maybe fix for windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
fubark committed Dec 10, 2023
1 parent 9af6f1d commit a75211f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cli.zig
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ fn zResolve(uvm: *cy.UserVM, chunkId: cy.ChunkId, curUri: []const u8, spec: []co

// Get canonical path.
chunk.tempBufU8.items.len += std.fs.MAX_PATH_BYTES;
if (builtin.os.tag == .windows) {
_ = std.mem.replaceScalar(u8, chunk.tempBufU8.items[path.len..], '/', '\\');
}
const absPath = std.fs.cwd().realpath(path, chunk.tempBufU8.items[path.len..]) catch |err| {
if (err == error.FileNotFound) {
const msg = try cy.fmt.allocFormat(vm.alloc, "Import path does not exist: `{}`", &.{v(path)});
Expand Down

0 comments on commit a75211f

Please sign in to comment.