mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 11:59:00 +00:00
fix(windows): transpiler cache and other test fixes (#8471)
* umask * process args * update reportError.test.ts * file exists * transpiler cache * back to const * remove failing comments * [autofix.ci] apply automated fixes * update comment * debug assert and remmove branch * oops * escape * path sep * seekTo * disable --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
This commit is contained in:
@@ -555,6 +555,7 @@ pub const CreateCommand = struct {
|
||||
package_json_contents = try MutableString.init(ctx.allocator, size);
|
||||
package_json_contents.list.expandToCapacity();
|
||||
|
||||
const prev_file_pos = if (comptime Environment.isWindows) try pkg.getPos() else 0;
|
||||
_ = pkg.preadAll(package_json_contents.list.items, 0) catch |err| {
|
||||
package_json_file = null;
|
||||
|
||||
@@ -565,6 +566,7 @@ pub const CreateCommand = struct {
|
||||
Output.prettyErrorln("Error reading package.json: <r><red>{s}", .{@errorName(err)});
|
||||
break :read_package_json;
|
||||
};
|
||||
if (comptime Environment.isWindows) try pkg.seekTo(prev_file_pos);
|
||||
// The printer doesn't truncate, so we must do so manually
|
||||
std.os.ftruncate(pkg.handle, 0) catch {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user