From 595477339b9e7dd696aaa31e21308f48c5a6109d Mon Sep 17 00:00:00 2001 From: Uko Kokņevičs Date: Tue, 26 Apr 2022 00:44:24 +0300 Subject: Add Installation.isActive, use it --- src/install.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/install.zig') diff --git a/src/install.zig b/src/install.zig index 7a52d44..ebf1c01 100644 --- a/src/install.zig +++ b/src/install.zig @@ -87,8 +87,9 @@ pub fn perform(allocator: Allocator, name: []const u8, force: bool, available: I } std.log.info("Installed to {s}", .{installation_dir}); - // TODO: Check if it is already active - std.log.info("If you want to use this installation, run `zup switch {s}`", .{name}); + if (!try Installation.isActive(allocator, name)) { + std.log.info("If you want to use this installation, run `zup switch {s}`", .{name}); + } } fn preparePathname(allocator: Allocator, installation_dir: []const u8, source: []const u8) ![:0]u8 { -- cgit v1.2.3