Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clean command for zvm module #1060

Merged
merged 1 commit into from
Feb 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions modules/zvm/zvm.nu
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,21 @@ export def "zvm remove" [
echo $"Successfully removed Zig ($zig_to_remove.version)"
}

# Remove unused versions
export def "zvm clean" [] {
let versions_to_remove = zvm list --system | where active == false | get version
if ($versions_to_remove | is-empty) {
print "No unused version to remove"
return
}

let path_prefix = get_or_create_path_prefix
for v in $versions_to_remove {
rm --recursive --permanent $"($path_prefix)/($v)"
}
echo $"Successfully removed the following unused versions:\n($versions_to_remove)"
}

def verify_signature [temp_dir: string, tarball: string] {
http get $"($tarball).minisig" | save $"($temp_dir)/($tarball | path basename).minisig"

Expand Down