Skip to content

Commit 3a659e4

Browse files
committed
fix: chmod executables only on non-windows systems
1 parent cebe9a5 commit 3a659e4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/update-self.zig

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ pub fn update_self(alloc: Allocator, cp: CommonPaths) !void {
6868
};
6969

7070
try download_tarball.createDownloadFile(cp);
71+
defer download_tarball.deinit() catch {};
7172
if (download_tarball.file_size < download_tarball.actual_size)
7273
try install.download_tarball(alloc, &client, download_tarball.url, &download_tarball.writer.?, download_tarball.file_size, download_tarball.actual_size);
7374
try download_tarball.file_handle.?.seekTo(0);
@@ -93,10 +94,11 @@ pub fn update_self(alloc: Allocator, cp: CommonPaths) !void {
9394
defer file.close();
9495

9596
try entry.decompressWriter(intf);
96-
try file.chmod(0o755);
97+
if (builtin.os.tag != .windows) {
98+
try file.chmod(0o755);
99+
}
97100
}
98-
std.debug.print("zigverm updated successfully\n", .{});
99-
defer download_tarball.deinit() catch {};
101+
std.log.info("zigverm updated successfully\n", .{});
100102
try cp.download_dir.deleteFile(full_dl_filename);
101103
}
102104

0 commit comments

Comments
 (0)