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

Implement zvm cleanup Command #27

Open
4 tasks
hendriknielaender opened this issue Feb 8, 2024 · 0 comments
Open
4 tasks

Implement zvm cleanup Command #27

hendriknielaender opened this issue Feb 8, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@hendriknielaender
Copy link
Owner

Summary

Introduce a new command zvm cleanup for the Zig Version Manager (ZVM) to help users easily remove unused or old versions of Zig from their disk. This feature aims to manage disk space more effectively by allowing users to clean up installations that are no longer in use.

Motivation

As developers work with multiple versions of Zig, over time, their systems can accumulate numerous outdated versions. These versions can take up significant disk space. Implementing a cleanup command would provide a convenient way to free up space and maintain a tidy development environment.

Proposed Solution

Implement a zvm cleanup command with the following functionalities:

  • List Unused Versions: Before performing any deletion, list the versions of Zig that are considered unused or old. This could be based on a lack of selection for a certain period or versions that are not set as the default or linked to any current project.

  • Safe Deletion: Ensure that the current default version and any versions explicitly marked as 'keep' are not removed. Provide a confirmation prompt to the user listing the versions to be deleted, requiring user confirmation to proceed.

  • Verbose Output Option: Include a verbose option (-v or --verbose) to provide detailed output of the cleanup process, including the amount of disk space freed.

  • Dry Run Option: Implement a dry run option (--dry-run) to show what would be deleted without actually removing the files, helping users make informed decisions.

Considerations

  • Compatibility: Ensure the command works across all platforms supported by ZVM (Linux, macOS, Windows).
  • Safety: Include checks to prevent accidental deletion of currently used versions or critical system files.
  • User Experience: Provide clear output messages and prompts to ensure a user-friendly experience.

Use Cases

  • Developers looking to free up disk space by removing old or unused versions of Zig.
  • Continuous integration environments where multiple versions of Zig may be tested, requiring periodic cleanup.

Implementation

  • Design and implement the logic to detect unused Zig versions.
  • Create the user interface for the zvm cleanup command, including prompts and help messages.
  • Test the feature across different platforms and scenarios to ensure reliability and safety.
  • Update documentation to include the new command and its usage.
@hendriknielaender hendriknielaender added enhancement New feature or request good first issue Good for newcomers labels Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant