https://github.com/rickmoynihan/wrapenv
Simple utility to wrap a command with an environment defined in an env file
https://github.com/rickmoynihan/wrapenv
bash command-line environment-variables shell unix
Last synced: about 1 month ago
JSON representation
Simple utility to wrap a command with an environment defined in an env file
- Host: GitHub
- URL: https://github.com/rickmoynihan/wrapenv
- Owner: RickMoynihan
- Created: 2017-02-23T15:01:50.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-14T20:27:26.000Z (almost 9 years ago)
- Last Synced: 2025-04-20T01:38:24.728Z (about 1 year ago)
- Topics: bash, command-line, environment-variables, shell, unix
- Language: Shell
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# wrapenv
Wrap a command with an environment defined in an env file. `wrapenv` is implemented as a light weight super simple 13 line bash script.
# Installation & Upgrading
Copy the line below and run it at a terminal to install wrapenv in
`~/bin`.
```
$ mkdir -p ~/bin && curl https://raw.githubusercontent.com/RickMoynihan/wrapenv/master/wrapenv > ~/bin/wrapenv && chmod +x ~/bin/wrapenv
```
## Create some environments
Create a directory in `~/.wrapenv` for your project environments.
`$ mkdir -p ~/.wrapenv/`
Create an env file in the project directory:
`echo MY_PROJET_ENV=foo > ~/.wrapenv/my-project/test.env`
# Usage
```
$ wrapenv
Usage: wrapenv
Available environments:
└── my-project
└── test
```
Running a process with wrapenv (as an example we run the `env` program to print the environment)
```
$ wrapenv my-project test env
TERM=xterm-256color
SHELL=/bin/bash
...
MY_PROJECT_ENV=foo
```
# License
Licensed under the [MIT license](https://opensource.org/licenses/MIT).
(c) 2017 Swirrl IT Ltd