Skip to content

Commit

Permalink
Maybe fix for windows.
Browse files Browse the repository at this point in the history
 Please enter the commit message for your changes. Lines starting
  • Loading branch information
fubark committed Dec 10, 2023
1 parent 9af6f1d commit 0976167
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cli.zig
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ fn zResolve(uvm: *cy.UserVM, chunkId: cy.ChunkId, curUri: []const u8, spec: []co
chunk.tempBufU8.items.len += std.fs.MAX_PATH_BYTES;
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)});
var msg = try cy.fmt.allocFormat(vm.alloc, "Import path does not exist: `{}`", &.{v(path)});
if (builtin.os.tag == .windows) {
_ = std.mem.replaceScalar(u8, msg, '/', '\\');
}
defer vm.alloc.free(msg);
try vm.setApiError(msg);
return error.HandledError;
Expand Down

0 comments on commit 0976167

Please sign in to comment.