mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
Merge branch 'jarred/prepare-for-libuv' of https://github.com/oven-sh/bun into jarred/prepare-for-libuv
This commit is contained in:
@@ -773,7 +773,7 @@ pub fn openDir(dir: std.fs.Dir, path_: [:0]const u8) !std.fs.IterableDir {
|
||||
const res = try sys.openDirAtWindowsA(toFD(dir.fd), path_, true, false).unwrap();
|
||||
return std.fs.IterableDir{ .dir = .{ .fd = fdcast(res) } };
|
||||
} else {
|
||||
const fd = try sys.openat(dir.fd, path_, std.os.O.DIRECTORY | std.os.O.CLOEXEC | 0, 0).unwrap();
|
||||
const fd = try sys.openat(dir.fd, path_, std.os.O.DIRECTORY | std.os.O.CLOEXEC | std.os.O.RDONLY, 0).unwrap();
|
||||
return std.fs.IterableDir{ .dir = .{ .fd = fd } };
|
||||
}
|
||||
}
|
||||
@@ -783,7 +783,7 @@ pub fn openDirA(dir: std.fs.Dir, path_: []const u8) !std.fs.IterableDir {
|
||||
const res = try sys.openDirAtWindowsA(toFD(dir.fd), path_, true, false).unwrap();
|
||||
return std.fs.IterableDir{ .dir = .{ .fd = fdcast(res) } };
|
||||
} else {
|
||||
const fd = try sys.openatA(dir.fd, path_, std.os.O.DIRECTORY | std.os.O.CLOEXEC | 0, 0).unwrap();
|
||||
const fd = try sys.openatA(dir.fd, path_, std.os.O.DIRECTORY | std.os.O.CLOEXEC | std.os.O.RDONLY, 0).unwrap();
|
||||
return std.fs.IterableDir{ .dir = .{ .fd = fd } };
|
||||
}
|
||||
}
|
||||
@@ -793,7 +793,7 @@ pub fn openDirAbsolute(path_: []const u8) !std.fs.Dir {
|
||||
const res = try sys.openDirAtWindowsA(invalid_fd, path_, true, false).unwrap();
|
||||
return std.fs.Dir{ .fd = fdcast(res) };
|
||||
} else {
|
||||
const fd = try sys.openA(path_, std.os.O.DIRECTORY | std.os.O.CLOEXEC | 0, 0).unwrap();
|
||||
const fd = try sys.openA(path_, std.os.O.DIRECTORY | std.os.O.CLOEXEC | std.os.O.RDONLY, 0).unwrap();
|
||||
return std.fs.Dir{ .fd = fd };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7258,9 +7258,11 @@ pub const PackageManager = struct {
|
||||
const cwd = std.fs.cwd();
|
||||
var node_modules_folder = cwd.openIterableDir("node_modules", .{}) catch brk: {
|
||||
skip_verify_installed_version_number = true;
|
||||
bun.sys.mkdir("node_modules", 0).throw() catch |err| {
|
||||
Output.prettyErrorln("<r><red>error<r>: <b><red>{s}<r> creating <b>node_modules<r> folder", .{@errorName(err)});
|
||||
Global.crash();
|
||||
bun.sys.mkdir("node_modules", 0o755).throw() catch |err| {
|
||||
if (err != error.EEXIST) {
|
||||
Output.prettyErrorln("<r><red>error<r>: <b><red>{s}<r> creating <b>node_modules<r> folder", .{@errorName(err)});
|
||||
Global.crash();
|
||||
}
|
||||
};
|
||||
break :brk cwd.openIterableDir("node_modules", .{}) catch |err| {
|
||||
Output.prettyErrorln("<r><red>error<r>: <b><red>{s}<r> opening <b>node_modules<r> folder", .{@errorName(err)});
|
||||
|
||||
Reference in New Issue
Block a user