Skip to content

Resolve Hermit binary from PATH in shell hooks - #587

Open
Noot-tooN wants to merge 3 commits into
cashapp:masterfrom
Noot-tooN:agent/use-installed-hermit-in-shell-hooks
Open

Resolve Hermit binary from PATH in shell hooks#587
Noot-tooN wants to merge 3 commits into
cashapp:masterfrom
Noot-tooN:agent/use-installed-hermit-in-shell-hooks

Conversation

@Noot-tooN

Copy link
Copy Markdown
Contributor

Summary

  • resolve the installed hermit executable from PATH when generating Bash, Zsh, and Fish shell hooks
  • quote the resolved executable path so installations in paths containing spaces work
  • execute the generated snippets in real Bash, Zsh, and Fish processes during tests
  • install Fish and Zsh in the CI test job so every supported shell is exercised

Why

The generated shell-hook configuration assumed Hermit was installed at $HOME/bin/hermit. Installations managed elsewhere, such as Homebrew at /opt/homebrew/bin/hermit, therefore produced an inactive hook: entering a Hermit environment did not update PATH, so project tools such as npx remained unavailable.

The hook installer now locates the same hermit executable already available on PATH while preserving an explicitly configured HERMIT_ROOT_BIN.

Validation

  • go test -count=1 ./...
  • ./bin/golangci-lint run
  • ./bin/lint-shell-scripts
  • git diff --check

Comment thread .github/workflows/ci.yml
Comment on lines +18 to +19
- name: Install shells
run: sudo apt-get install --no-install-recommends fish zsh

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how the maintainers of this repo would feel about this, but i don't see any proper way to test this feature out without this. 馃槃

@Noot-tooN
Noot-tooN marked this pull request as ready for review July 25, 2026 18:05
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