summaryrefslogtreecommitdiff
path: root/src/remove.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/remove.zig')
-rw-r--r--src/remove.zig7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/remove.zig b/src/remove.zig
index c1c35d4..ad1a610 100644
--- a/src/remove.zig
+++ b/src/remove.zig
@@ -21,12 +21,7 @@ pub fn main(comptime Result: type, allocator: Allocator, res: Result) !void {
21 return error.InstallationNotFound; 21 return error.InstallationNotFound;
22 } 22 }
23 23
24 const is_active = blk: { 24 const is_active = try Installation.isActive(allocator, name);
25 const active = try Installation.getActiveName(allocator);
26 defer if (active) |s| allocator.free(s);
27
28 break :blk active != null and std.mem.eql(u8, active.?, name);
29 };
30 25
31 if (is_active and !res.args.force) { 26 if (is_active and !res.args.force) {
32 std.log.err("{s} is the active installation, not removing without --force!", .{name}); 27 std.log.err("{s} is the active installation, not removing without --force!", .{name});