mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 03:18:53 +00:00
just kernel32 things (#4354)
* just kernel32 things * more * Update linux_c.zig * Update windows_c.zig * Add workaround Workaround https://github.com/ziglang/zig/issues/16980 * Rename http.zig to bun_dev_http_server.zig * Rename usages * more * more * more * thanks tigerbeetle * Rename `JSC.Node.Syscall` -> `bun.sys` * more * woops * more! * hmm * it says there are only 37 errors, but that's not true * populate argv * it says 32 errors! * 24 errors * fix regular build * 12 left! * Still 12 left! * more * 2 errors left... * 1 more error * Add link to Tigerbeetle * Fix the remainign error * Fix test timeout * Update syscall.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
This commit is contained in:
@@ -110,12 +110,25 @@ pub const InitCommand = struct {
|
||||
initializeStore();
|
||||
read_package_json: {
|
||||
if (package_json_file) |pkg| {
|
||||
const stat = pkg.stat() catch break :read_package_json;
|
||||
const size = brk: {
|
||||
if (comptime bun.Environment.isWindows) {
|
||||
const end = pkg.getEndPos() catch break :read_package_json;
|
||||
if (end == 0) {
|
||||
break :read_package_json;
|
||||
}
|
||||
|
||||
if (stat.kind != .file or stat.size == 0) {
|
||||
break :read_package_json;
|
||||
}
|
||||
package_json_contents = try MutableString.init(alloc, stat.size);
|
||||
break :brk end;
|
||||
}
|
||||
const stat = pkg.stat() catch break :read_package_json;
|
||||
|
||||
if (stat.kind != .file or stat.size == 0) {
|
||||
break :read_package_json;
|
||||
}
|
||||
|
||||
break :brk stat.size;
|
||||
};
|
||||
|
||||
package_json_contents = try MutableString.init(alloc, size);
|
||||
package_json_contents.list.expandToCapacity();
|
||||
|
||||
_ = pkg.preadAll(package_json_contents.list.items, 0) catch {
|
||||
|
||||
Reference in New Issue
Block a user