Skip to content

feat: Uninstall a specific version (adds --version)#285

Open
dogo wants to merge 8 commits intoyonaskolb:masterfrom
dogo:feature/remove-specific-version
Open

feat: Uninstall a specific version (adds --version)#285
dogo wants to merge 8 commits intoyonaskolb:masterfrom
dogo:feature/remove-specific-version

Conversation

@dogo
Copy link
Copy Markdown

@dogo dogo commented Nov 16, 2025

You can now uninstall a single installed version instead of always nuking all versions and there’s a new -v/--version flag.

Implemented as requested #206

Comment thread Sources/MintCLI/Commands/UninstallCommand.swift Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds the ability to uninstall a specific version of a package instead of removing all installed versions. A new -v/--version flag is added to the uninstall command to specify which version to remove.

  • Modified Mint.uninstall() to accept an optional version parameter and implement version-specific uninstallation logic
  • Added -v/--version flag to UninstallCommand
  • Implemented logic to preserve package metadata and remaining versions when only specific versions are removed

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
Sources/MintCLI/Commands/UninstallCommand.swift Adds the --version parameter to the uninstall command
Sources/MintKit/Mint.swift Updates the uninstall method to support removing specific versions with fuzzy matching, while preserving other installed versions and their metadata
Tests/MintTests/MintTests.swift Adds test case to verify that uninstalling a specific version removes only that version while preserving others and their symlinks
Comments suppressed due to low confidence (1)

Sources/MintKit/Mint.swift:676

  • When removing a specific version, the code removes resource artifact links (bundles, dylibs, etc.) associated with that version without checking if remaining versions also use resources with the same name. If multiple versions share a resource file name, the symlink will be removed even though a remaining version still needs it. Consider checking if remaining versions contain resources with the same lastComponent before removing the links.
        // remove resource artifact links related only to removed versions
        for resource in resources {
            let installPath = linkPath + resource.lastComponent
            try installPath.delete()
        }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Sources/MintKit/Mint.swift Outdated
@dogo dogo requested a review from yonaskolb December 11, 2025 09:14
Co-authored-by: Copilot <[email protected]>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

Sources/MintKit/Mint.swift:684

  • When uninstalling a specific version while other versions remain, this code removes resource links that may still be needed by the remaining versions. Each version has its own copy of resources (bundles, dylibs, etc.) in its install path, and the linked version's resources should remain symlinked in the linkPath. Consider checking if any remaining versions have executables that are linked before removing the resource links, or re-link resources from a remaining version after cleanup.
        // remove resource artifact links related only to removed versions
        for resource in resources {
            let installPath = linkPath + resource.lastComponent
            try installPath.delete()
        }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Tests/MintTests/MintTests.swift Outdated
Comment thread Sources/MintKit/Mint.swift
Comment thread Sources/MintKit/Mint.swift
…s when no remaining installed version still references the same artifact
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Sources/MintCLI/Commands/UninstallCommand.swift Outdated
Comment thread Tests/MintTests/MintTests.swift
Comment thread Tests/MintTests/MintTests.swift Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Sources/MintKit/Mint.swift
Comment thread Tests/MintTests/MintTests.swift
Comment thread Tests/MintTests/MintTests.swift
Comment thread Tests/MintTests/MintTests.swift
Comment thread Tests/MintTests/MintTests.swift
Comment thread Sources/MintKit/Mint.swift
Comment thread Sources/MintKit/Mint.swift
Comment thread Sources/MintKit/Mint.swift Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Sources/MintKit/Mint.swift
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Sources/MintCLI/Commands/UninstallCommand.swift Outdated
Use uppercase -V for --version to avoid confusion with -v (--verbose)
used in other Mint commands like install, run, and bootstrap.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dogo
Copy link
Copy Markdown
Author

dogo commented Dec 15, 2025

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

It's was a long battle but we finally came in an agreement hehehe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants