fix: refresh preset commands on re-init to apply replaces logic (v0.1.5)#82
Merged
fix: refresh preset commands on re-init to apply replaces logic (v0.1.5)#82
Conversation
When running 'specify init --here' on a project with an existing preset, the 'replaces' field was not being applied because the preset was skipped as 'already installed'. - Add refresh_preset_commands() method to PresetManager - Call refresh for existing presets in install_bundled_presets() - Ensures speckit.* commands are removed even when .specify/ persists This fixes the issue where users had to delete both .specify/ and .opencode/ to get clean command namespaces after upgrading to v0.1.3+.
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
Fixes the issue where
speckit.*commands persisted even after upgrading to v0.1.3+ and runningspecify init --here.Problem
When running
specify init --hereon a project with an existing preset, thereplacesfield was not being applied becauseinstall_bundled_presets()skipped the preset as "already installed":Users had to delete both
.specify/AND.opencode/to get clean command namespaces.Solution
refresh_preset_commands()method toPresetManagerthat re-runs command registration for existing presetsinstall_bundled_presets()to callrefresh_preset_commands()for existing presets before skipping themResult
Now when running
specify init --herewith an existing.specify/directory:_register_commands()is called which applies thereplaceslogicspeckit.*commands are removed, leaving onlyadlc.spec.*andspec.*Testing
specify init --ai opencode --hereon project with existing.specify/now produces correct command set