A cross-shell env sourcing command.
I use fish a lot, but I also like to do
bash
source .env
when I want to source specific environment variables for a shell session.
As far as I know fish
doesn't have this capability, and I figured I would write something that could work across different shells, just in case I switch to zsh
or something else.
For now to install it, you need cargo
installed. Once installed run the following command:
fish
cargo install xenv
```fish
xenv echo hello this is my command
env XPATH_ENV=xenv.env xenv env | rg foo
```
It'll follow the format for any .env
file, but for reference, here's the docker-compose .env rules
```bash
FOO=bar
foo=bar
=qux
BANG= ```