Closed sevein closed 8 months ago
@sevein would a similar script be helpful for Bash, or are the tool versions already handled in Bash by the Makefile? I use Zsh and I don't want to introduce spurious changes because I have the wrong tool version.
@sevein would a similar script be helpful for Bash, or are the tool versions already handled in Bash by the Makefile? I use Zsh and I don't want to introduce spurious changes because I have the wrong tool version.
zsh can run the normal source activate code that fish cannot. The reason is that fish is not posix complaint shell at all. for example in fish a variable is defined via the set command. This breaks almost all bash scripts when porting to fish. it is why i usually just execute bash scripts on my fish shell via bash -c "
Virtual environments created with python3 -m venv
populate four activate bin scripts for different shell types. I've uploaded an example from my a3m venv: https://gist.github.com/sevein/0f4f072143f6eb38954867282c56ec1c.
Perhaps we should have: hack/activate/bash
and hack/activate/fish
? Sounds like that'd cover all our use cases.
Let me know and I'll do it.
@sevein I don't know if hack/fish is necessary because the binary version control in the individual make scripts (e.g. hack/make/dep_mockgen.mk) doesn't work in fish, or if hack/fish
has some other purpose. If the fish activation script provides extra functionality, then yes, I'd like to have it for bash/zsh as well. :)
This pull request includes a path activation script for the fish shell inspired by Python's virtual environments.
Usage:
It adds the local binary cache directory of the project to the PATH environment string. Now you can use tools like ent, goa, golangci-lint, gomajor, gosec, gotestsum, mockgen, shfmt or tparse with the confidence of using the versions required by this project as opposed to any global version you have installed previously.
If you're using devbox, the equivalent would be to execute
devbox shell
.