From dc051ae8108da0ee227f1cd50aa28c0e8f4b1abe Mon Sep 17 00:00:00 2001 From: Dylan Conway Date: Fri, 31 May 2024 17:44:35 -0700 Subject: [PATCH] Revert "fix windows todo" This reverts commit ec09e6e238fc035e626ac3389dda5df7ca20387c. --- src/cli/create_command.zig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cli/create_command.zig b/src/cli/create_command.zig index 5d8fff92b3..76b97fb4cf 100644 --- a/src/cli/create_command.zig +++ b/src/cli/create_command.zig @@ -509,12 +509,12 @@ pub const CreateCommand = struct { var infile = try openFile(entry.dir, entry.basename, .{ .mode = .read_only }); defer infile.close(); - // Assumption: you only really care about making sure something that was executable is still executable - switch (bun.sys.fstat(bun.toFD(infile.handle))) { - .err => {}, - .result => |stat| { - _ = bun.sys.fchmod(bun.toFD(outfile.handle), @intCast(stat.mode)); - }, + if (comptime Environment.isPosix) { + // Assumption: you only really care about making sure something that was executable is still executable + const stat = infile.stat() catch continue; + _ = C.fchmod(outfile.handle, @intCast(stat.mode)); + } else { + @panic("TODO on Windows"); } CopyFile.copyFile(infile.handle, outfile.handle) catch |err| {