fix(cli): replace stale data/scripts pointer files on install (#237)#386
Merged
mrgoonie merged 1 commit intoJun 25, 2026
Conversation
On Windows, an older install (or a git checkout that materialized the repo's symlinked data/scripts as plain "pointer" files) leaves a regular file at <skill>/data or <skill>/scripts. copyDataAndScripts then calls mkdir on that path, which throws EEXIST; under `uipro init --ai all` the per-platform error is swallowed, leaving e.g. codex with the stale pointer files and no real directories. Add ensureCleanDir(): before mkdir, lstat the target and remove it if it is not already a directory. Existing real directories are preserved (re-install is unaffected). Verified with a repro harness. Closes nextlevelbuilder#237
Contributor
Author
|
@mrgoonie another quick fix, while you're still around! |
mrgoonie
approved these changes
Jun 25, 2026
mrgoonie
left a comment
Contributor
There was a problem hiding this comment.
Summary: PR #386 is a narrow installer migration for issue #237. It changes only cli/src/utils/template.ts, adding ensureCleanDir() so stale plain-file data/scripts pointer paths are removed before creating real directories during platform install.
Risk level: Low. Single-file, 20-line change in the CLI install path.
Mandatory gates:
- Duplicate / prior implementation: clear. GitHub search found only this PR for the exact stale pointer-file install cleanup; related PR #302 is a broader direct Codex package and does not address this migration path.
- Project standards: docs/source-of-truth pattern found; change stays in existing CLI template utility and does not touch generated assets.
- Strategic necessity: clear value. It directly addresses Windows/legacy-upgrade broken installs from #237 without broad packaging churn.
Findings: none blocking.
Verification notes:
- Inspected linked issue #237, PR body, full diff, changed file context, related search results, and current CLI install code.
- Local
npm --prefix cli run typecheckcould not run because this checkout lacks installed dev dependency binarytsc; nonode_modulespresent. This is an environment limitation, not a PR finding. The PR is small enough to review statically. - GitHub reports no checks for branch
fix/cli-installer-stale-pointer-dirs.
Verdict: Approve. If GitHub accepts merge with no required checks, merge after approval because mergeStateStatus=CLEAN and the change is narrow.
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.
What & why
On Windows,
uipro init(especially--ai all) can leave a platform — e.g. codex — with brokendata/scriptspointer files instead of real directories (#237).Root cause: if
<skill>/dataor<skill>/scriptsalready exists as a plain file (left by an older CLI, or by a git checkout that materialized the repo's symlinkeddata/scriptsas text "pointer" files),copyDataAndScriptscallsmkdir(target, { recursive: true })on that path, which throwsEEXIST. Under--ai all,generateAllPlatformFilesswallows the per-platform error (template.ts:238), so that platform is left with the stale pointer files and no real directories — exactly the reported symptom. A clean install is unaffected, which is why a fresh temp-dir install "works".Fix
Add
ensureCleanDir(): beforemkdir,lstatthe target and remove it only if it isn't already a directory. Existing real directories are preserved, so re-installs are unaffected. Applied before both thedataandscriptscopies (the same path runs for all 18 platforms, so no platform regresses).Verification
npm --prefix cli run typecheckpasses.mkdiron a pointer file throwsEEXIST; with it,databecomes a real directory with the copied contents, and a pre-existing real directory is preserved on re-install.Scope
cli/src/utils/template.ts, no behavior change for clean installs..claude/skills/, not the CLI installer).Closes #237