Skip to content

fix(gitSetupShell): do not hardcode bash location#972

Open
xav-ie wants to merge 1 commit into
mksglu:nextfrom
xav-ie:fix/nix-test-bash
Open

fix(gitSetupShell): do not hardcode bash location#972
xav-ie wants to merge 1 commit into
mksglu:nextfrom
xav-ie:fix/nix-test-bash

Conversation

@xav-ie

@xav-ie xav-ie commented Jul 18, 2026

Copy link
Copy Markdown

What / Why / How

The cross-project-attribution test sets up temp git repos through
shell: "/bin/bash". That path does not exist on NixOS, where bash lives in the
Nix profile rather than /bin, so the whole suite fails at setup with ENOENT.

Switch the hardcoded /bin/bash to a bare "bash" so Node resolves it from
PATH. This keeps bash semantics (the setup runs git init && git remote add)
and matches how shipped code already picks a shell (commandExists("bash") in
src/runtime.ts). win32 keeps execSync's default shell, unchanged.

Affected platforms

Test-only change; no adapter or product behavior changes. Impacts any host
where bash is not at /bin/bash (NixOS, and other non-FHS layouts).

  • All platforms

Test plan

Existing tests/integration/cross-project-attribution.test.ts is the coverage.
On a host without /bin/bash it goes from 5 failing (ENOENT in beforeAll setup)
to 5 passing. No product code changed, so no new test was added; adding one
would only re-test Node + bash.

Verified locally:

  • before (bare next): 5 failed, all ENOENT from /bin/bash
  • after: 5 passed

Checklist

  • Tests added/updated (the fixed suite is the coverage; see Test plan)
  • npm test passes
  • npm run typecheck passes
  • Docs updated if needed (n/a)
  • No Windows path regressions (forward slashes only)
  • Targets next branch

Allow `bash` to resolve from $PATH. This allows environments which do
not have `/bin/bash` to resolve their own chosen location.
@xav-ie
xav-ie marked this pull request as ready for review July 18, 2026 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant