mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-15 07:36:50 +03:00
fix(cli): use imported resolve/sep in hermesGlobalHome (#521)
The function called `path.resolve` and `path.sep` but only named- imports `resolve` and `sep` from `node:path`. The ReferenceError was swallowed by the try/catch, so $HERMES_HOME was silently ignored and profile-scoped installs always landed in ~/.hermes instead of the active profile. Greptile (P1) and Cursor Bugbot (High) flagged this on 2026-08-10. Adds 6 regression tests covering default, default- profile, active-profile, cross-home leakage, the override map integration, and the full e2e pipeline. Verified by reverting the fix and observing the relevant tests fail.
This commit is contained in:
@@ -102,13 +102,13 @@ function hermesGlobalHome(home) {
|
||||
const envHome = process.env.HERMES_HOME;
|
||||
if (envHome) {
|
||||
try {
|
||||
const resolvedEnv = path.resolve(envHome);
|
||||
const resolvedHome = path.resolve(home);
|
||||
const resolvedEnv = resolve(envHome);
|
||||
const resolvedHome = resolve(home);
|
||||
// Honor HERMES_HOME only when it lives under the active home (real
|
||||
// ~/.hermes or ~/.hermes/profiles/<name>). Cross-home inheritance is
|
||||
// treated as not-set, so a test running under HOME=/tmp/... doesn't
|
||||
// pick up the developer's real ~/.hermes.
|
||||
if (resolvedEnv === resolvedHome || resolvedEnv.startsWith(resolvedHome + path.sep)) {
|
||||
if (resolvedEnv === resolvedHome || resolvedEnv.startsWith(resolvedHome + sep)) {
|
||||
return resolvedEnv;
|
||||
}
|
||||
} catch {
|
||||
@@ -2271,6 +2271,8 @@ export {
|
||||
expectedHookDests,
|
||||
extractZip,
|
||||
formatInstallDetectionLines,
|
||||
hermesGlobalHome,
|
||||
HOME_SKILLS_DIR_OVERRIDES,
|
||||
linkProviderSkills,
|
||||
mergeHookManifests,
|
||||
migrateUnprefixImpeccable,
|
||||
|
||||
Reference in New Issue
Block a user