Repository navigation
🐛 fix(autodetect): treat empty env var as not detected - #331
Conversation
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
hive/awaiting-ci: CI pending — sweep will merge when green. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
There was a problem hiding this comment.
Read src/autodetect.ts at 710b801 and its three callers (src/resolver.ts:137, src/commands.ts:145, src/ui.ts:45). The new value === '' check at src/autodetect.ts:126 makes the env fallback match what the git detectors already do (git() returns out || undefined, src/autodetect.ts:26), so an EDITOR= now falls through to the {{EDITOR=vim}} default at resolver.ts:144 and to the interactive prompt at resolver.ts:151 instead of resolving to ''. Rebuilt locally: dist/ is in sync with src/ (clean git status -- dist/) and npm test passes 462/462. Looks correct to me.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Closes #330
Bug
An environment variable set to an empty string (e.g.,
EDITOR=) was treated as a filled value, overriding template defaults ({{EDITOR=vim}}) and suppressing interactive prompts.Fix
In
src/autodetect.ts, updated the env fallback to treat empty strings the same as undefined values, matching the behavior of explicit--FOO=flags and git detectors (see #91).Changes
autodetect()to returnundefinedfor empty env varssrc/autodetect.test.tsverifying empty vars are treated as not detectedchangelog.d/fixed-autodetect-empty-env.mddist/autodetect.js,.js.map, and test outputs)— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88