https://github.com/jonlabelle/dotenv-sh
Loads variables from dotenv (.env) files into your environment.
https://github.com/jonlabelle/dotenv-sh
bash dotenv environment sh
Last synced: 18 days ago
JSON representation
Loads variables from dotenv (.env) files into your environment.
- Host: GitHub
- URL: https://github.com/jonlabelle/dotenv-sh
- Owner: jonlabelle
- License: mit
- Created: 2021-12-06T07:21:23.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-30T19:47:58.000Z (over 4 years ago)
- Last Synced: 2025-01-23T03:29:25.463Z (over 1 year ago)
- Topics: bash, dotenv, environment, sh
- Language: Shell
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
## dotenv.sh
[](https://github.com/jonlabelle/dotenv-sh/actions/workflows/lint.yml)
> Loads variables from dotenv (`.env`) files into your environment.
## Install
Clone the [repository] then run the [install script] to create the symlink in
`~/bin/dotenv`:
```bash
git clone https://github.com/jonlabelle/dotenv-sh.git
cd dotenv-sh
bash scripts/install.sh
```
## Usage
```bash
source dotenv [environment]
```
## Examples
To load variables in the `.env` file from current working directory:
```bash
source dotenv
```
To load variables in the `.env.local` file from current working directory:
```bash
source dotenv local
```
## References
- [Set Environment Variables in Your Bash Shell From a .env File \(Version 2\)](https://zwbetz.com/set-environment-variables-in-your-bash-shell-from-a-env-file-version-2/)
- [Load environment variables from dotenv / .env file in Bash](https://gist.github.com/mihow/9c7f559807069a03e302605691f85572)
## License
[MIT](LICENSE.txt)
[repository]: https://github.com/jonlabelle/dotenv-sh.git
[install script]: https://github.com/jonlabelle/dotenv-sh/blob/main/scripts/install.sh