Repository navigation
fix(workspace): make install.sh idempotent for template_project rename (#197) - #201
Merged
Merged
Conversation
Refs: #197 Co-authored-by: Cursor <[email protected]>
…t rename
On re-run with --force, rsync re-copies src/template_project/ (since it was
renamed on first run). The mv command then moves it inside the existing
src/${SHORT_NAME}/ directory, creating a nested src/${SHORT_NAME}/template_project/.
Guard the rename: if src/${SHORT_NAME} already exists, remove the redundant
src/template_project instead of moving it.
Refs: #197
Co-authored-by: Cursor <[email protected]>
Refs: #197 Co-authored-by: Cursor <[email protected]>
The single-quoted string is intentional — we check for the literal
${SHORT_NAME} in the script source, not an expansion.
Refs: #197
Co-authored-by: Cursor <[email protected]>
This was referenced Feb 25, 2026
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.
Description
Fix
install.sh(viainit-workspace.sh) to be idempotent when run with--forceon an already-initialized workspace. On second run, rsync re-copiessrc/template_project/and themvcommand moves it inside the existingsrc/${SHORT_NAME}/directory, creating a nestedsrc/${SHORT_NAME}/template_project/. The fix guards the rename: if the destination already exists, the redundant copy is removed instead.Type of Change
feat-- New featurefix-- Bug fixdocs-- Documentation onlychore-- Maintenance task (deps, config, etc.)refactor-- Code restructuring (no behavior change)test-- Adding or updating testsci-- CI/CD pipeline changesbuild-- Build system or dependency changesrevert-- Reverts a previous commitstyle-- Code style (formatting, whitespace)Modifiers
!) -- This change breaks backward compatibilityChanges Made
assets/init-workspace.sh— Guard themv src/template_project src/${SHORT_NAME}block: if the destination directory already exists (and SHORT_NAME is not "template_project"), remove the redundant rsync-copiedsrc/template_projectinstead of moving it inside the existing directory.tests/bats/init-workspace.bats— BATS test verifying the idempotent guard clause exists in the script (checks for therm -rfbranch alongsidesrc/${SHORT_NAME}).CHANGELOG.md— Entry under## Unreleased/### Fixed.Changelog Entry
Fixed
src/${SHORT_NAME}already exists, remove the redundant copy instead of moving it insideTesting
just test)Manual Testing Details
N/A — functional testing of init-workspace.sh requires a container environment (covered by integration tests in CI).
Checklist
docs/templates/, then runjust docs)CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
N/A
Refs: #197