You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b9a769c
Browse filesBrowse the repository at this point in the historyBrowse files
fix: correct .local/bin regression and revert collateral reformat (#1305)
Self-review and CI turned up three problems with the previous commit.
1. The `.local/bin` claim was wrong, and removing the branch was a regression.
The commit message and PR said `.local/bin` misclassified npm installs made with
`npm config set prefix ~/.local`. It does not. With that prefix, packages land in
`~/.local/lib/node_modules/...` and only the shim sits in `~/.local/bin`; since
execPath is the spawned platform binary, it never contains `.local/bin` for a
package-manager install, so the branch could not misfire that way.
Removing it deleted correct back-compat from #820 (distro-resolved standalone
installs), which test/sanity/Dockerfile also relies on, and broke four tests that
said so explicitly. Restored — but AFTER the node_modules match, which is what makes
it safe and is the real improvement over the original ordering. Both layouts now
resolve correctly, with a test asserting exactly that.
2. Running prettier over the whole file reformatted code this change never touched
(`upgradeCurl`, `upgradePowershell`, `defaultLayer`), because the committed file
predates the repo's printWidth of 120. That broke two source-shape tests and tripped
Marker Guard, which reads reformatted upstream lines as unmarked custom code.
Formatting is not CI-enforced here, so it bought nothing. Rebuilt the file from the
pristine version with only the intended edits re-applied.
3. `import { Global }` pulled in a module-load side effect: core/global.ts runs a
top-level `await Promise.all([...mkdir...])`, creating seven directories merely by
loading the module, and dragged that into every unit test importing resolveInstall().
Replaced with a lazy import matching the existing getTelemetry() pattern.
Also converted the #820 detection tests from source-text assertions to behavioural ones
now that resolveInstall() is pure, and documented that `access(W_OK)` reflects the
read-only attribute rather than the ACL on Windows, so the preflight degrades to a no-op
there instead of falsely blocking.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
return`Cannot write to the npm global prefix (${dir}). Run \`sudo npm install -g ${pkg}\`, or switch to a user-owned prefix with \`npm config set prefix ~/.npm-global\`.`
352
+
return(
353
+
`Cannot write to the npm global prefix (${dir}). `+
354
+
`Run \`sudo npm install -g ${pkg}\`, or switch to a user-owned prefix `+
355
+
`with \`npm config set prefix ~/.npm-global\`.`
356
+
)
333
357
case"pnpm":
334
-
return`Cannot write to the pnpm global directory (${dir}). Run \`pnpm setup\` to use a user-owned location, or re-run the install with elevated permissions.`
358
+
return(
359
+
`Cannot write to the pnpm global directory (${dir}). `+
360
+
`Run \`pnpm setup\` to use a user-owned location, or re-run the install with elevated permissions.`
361
+
)
335
362
case"bun":
336
-
return`Cannot write to the bun global bin directory (${dir}). Set BUN_INSTALL to a user-owned location, or re-run the install with elevated permissions.`
363
+
return(
364
+
`Cannot write to the bun global bin directory (${dir}). `+
365
+
`Set BUN_INSTALL to a user-owned location, or re-run the install with elevated permissions.`
366
+
)
337
367
case"yarn":
338
-
return`Cannot write to the yarn global directory (${dir}). Set a user-owned prefix with \`yarn config set prefix ~/.yarn\`, or re-run with elevated permissions.`
368
+
return(
369
+
`Cannot write to the yarn global directory (${dir}). `+
370
+
`Set a user-owned prefix with \`yarn config set prefix ~/.yarn\`, or re-run with elevated permissions.`
371
+
)
339
372
case"curl":
340
373
return`Cannot write to the install directory (${dir}). Fix its permissions, or re-run the installer.`
`or download a release binary directly from https://github.com/AltimateAI/altimate-code/releases/latest`,
`or download a release binary directly from https://github.com/AltimateAI/altimate-code/releases/latest`,
`or download a release binary directly from https://github.com/AltimateAI/altimate-code/releases/latest`,
`or download a release binary directly from https://github.com/AltimateAI/altimate-code/releases/latest`,
0 commit comments