diff options
Diffstat (limited to 'src/which_npm_client.zig')
-rw-r--r-- | src/which_npm_client.zig | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/which_npm_client.zig b/src/which_npm_client.zig index 25e5b2ea1..56dd752c1 100644 --- a/src/which_npm_client.zig +++ b/src/which_npm_client.zig @@ -69,9 +69,10 @@ pub const NPMClient = struct { "npm", ) orelse ""; - var file = std.fs.openFileAbsoluteZ(path, .{ .read = true }) catch return null; - defer file.close(); - break :brk std.os.getFdPath(file.handle, realpath_buf) catch return null; + std.mem.copy(u8, realpath_buf, std.mem.span(path)); + // It's important we don't resolve the symlink + // That breaks volta. + break :brk realpath_buf[0..path.len]; }; const basename = std.fs.path.basename(std.mem.span(out_path)); |