mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 03:48:56 +00:00
fix: which should use cwd if given a relative filepath (#9761)
* Revert "fix!: do not lookup cwd in which (#9691)"
This reverts commit 4869ebff24.
* fix which implementation to be more accurate
* t
* which tests windows
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -713,6 +713,7 @@ pub const StandaloneModuleGraph = struct {
|
||||
if (bun.which(
|
||||
&whichbuf,
|
||||
bun.getenvZ("PATH") orelse return error.FileNotFound,
|
||||
"",
|
||||
bun.argv()[0],
|
||||
)) |path| {
|
||||
return bun.toFD((try std.fs.cwd().openFileZ(path, .{})).handle);
|
||||
|
||||
Reference in New Issue
Block a user