Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rory660/with-env
https://github.com/rory660/with-env
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rory660/with-env
- Owner: rory660
- License: gpl-3.0
- Created: 2023-10-27T11:10:57.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-27T11:59:14.000Z (about 1 year ago)
- Last Synced: 2023-10-28T12:35:11.789Z (about 1 year ago)
- Language: Shell
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# with-env
Run any arbitrary command with a `.env` file.
## Why?
`with-env` eliminates the need to load environment variables from a file within your program, eliminating calls that are redundant to production, and separating environment management from the code itself.
## Usage
```sh
with-env
```Requires a `.env` file in your current working directory.
## Options
### `-f`: Use a specific `env` file (overrides default `.env` file usage)
```sh
with-env -f
```## Example
### `.env` File (in current working directory)
```
# .env
FOO='bar'
```### Command
```sh
$ with-env printenv FOO
bar
```