mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 03:18:53 +00:00
fix windows todo
This commit is contained in:
@@ -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| {
|
||||
|
||||
Reference in New Issue
Block a user