diff --git a/src/cli/create_command.zig b/src/cli/create_command.zig index 76b97fb4cf..5d8fff92b3 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(); - 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"); + // 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)); + }, } CopyFile.copyFile(infile.handle, outfile.handle) catch |err| {