feat: add native flush, config, and cache commands#440
Closed
youngledo wants to merge 1 commit into
Closed
Conversation
Migrate three pure-filesystem Bash commands to Rust as part of the ongoing Bash-to-Rust migration (Phase 1): - flush: remove and recreate tmp, metadata, version directories with disk usage reporting - config: open $SDKMAN_DIR/etc/config in the user's $EDITOR (defaults to vi) - cache: validate that the candidates cache file exists and is non-empty These commands follow the existing binary pattern with no architectural changes required. Refs: sdkman#439
Contributor
|
Thanks for the PR! We appreciate the effort, but we do have contributor guidelines that we'd like all contributors to follow before opening PRs. On the technical side: we already have a roadmap to migrate all the Bash commands to Rust, but this is sequenced after the backend work (sdkman-state migration) is complete. Once that's stable, we'll migrate the remaining subcommands in a coordinated way. Please reach out in our Discord community if you'd like to discuss the migration roadmap or how you can help! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrate three pure-filesystem Bash commands to Rust as Phase 1 of the complete Bash-to-Rust migration proposed in #439.
flush: Remove and recreatetmp,var/metadata, andvar/versiondirectories with disk usage reporting. Supports qualifiers:tmp,metadata,version, or flush all by default.config: Open$SDKMAN_DIR/etc/configin the user's$EDITOR(defaults tovi). Supports editors with arguments (e.g.,EDITOR="code --wait").cache: Validate that the candidates cache file at$SDKMAN_DIR/var/candidatesexists and is non-empty. Displays a warning with remediation instructions if corrupt.Context
This is the first deliverable from the RFC in #439. These three commands were chosen because:
Test plan
cargo test— all 58 tests pass (11 new + 47 existing), zero regressionscargo clippy— zero new warnings on the three new binariesflush: 5 tests covering default flush, tmp-only, metadata-only, version, and empty directoryconfig: 2 tests covering missing editor and successful editor launchcache: 4 tests covering valid cache, empty cache, missing cache, and whitespace-only cacheRefs: #439