From 9178c98e776cf69276029d216be0b14ee9ec4cc2 Mon Sep 17 00:00:00 2001 From: Arijit Dey Date: Wed, 13 Nov 2024 02:23:18 +0530 Subject: [PATCH] feat: report updated versions --- src/main.zig | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main.zig b/src/main.zig index 417de76..1f87b6c 100644 --- a/src/main.zig +++ b/src/main.zig @@ -220,6 +220,7 @@ fn update_zig_installation(alloc: Allocator, cp: CommonPaths, version_possible: versions = @constCast(&[1][]const u8{v}); } else versions = try installed_versions(alloc, cp); + var updated_now = std.ArrayList([]const u8).init(alloc); var already_update = std.ArrayList([]const u8).init(alloc); var client = Client{ .allocator = alloc }; defer client.deinit(); @@ -262,6 +263,7 @@ fn update_zig_installation(alloc: Allocator, cp: CommonPaths, version_possible: } } if (to_update) { + try updated_now.append(v); try install.install_release(alloc, &client, releases, &rel, cp); } else { try already_update.append(v); @@ -270,9 +272,11 @@ fn update_zig_installation(alloc: Allocator, cp: CommonPaths, version_possible: try install.install_release(alloc, &client, releases, &rel, cp); } } - if (already_update.items.len > 0) std.debug.print("\n", .{}); - + std.debug.print("\n", .{}); + for (updated_now.items) |v| { + std.debug.print("\t{s: <6} : Updated\n", .{v}); + } for (already_update.items) |v| { - std.debug.print("\t{s: <6} : Up to date\n", .{v}); + std.debug.print("\t{s: <6} : Already Up to date\n", .{v}); } }