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:
Dylan Conway
2024-01-29 15:17:23 -08:00
committed by GitHub
parent 1e9b44adda
commit c538bf87d1
24 changed files with 106 additions and 49 deletions

View File

@@ -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 {};