fix windows todo

This commit is contained in:
Dylan Conway
2024-05-31 17:44:13 -07:00
parent d9f7d053d5
commit ec09e6e238

View File

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