Skip to main content

Prefix commands with specific environments specified in YAML files.

Project description

https://travis-ci.org/ionrock/withenv.png?branch=master https://pypip.in/d/withenv/badge.png

We use environment variables all the time, but they can be painful to maintain because a shell is sticky. It is too easy to set an environment variable in your shell, only to have that variable stick around when you change projects.

withenv aims to help this problem by providing a simple way to prefix commands targeting YAML files that will be added to the environment prior to the command running.

Usage

The withenv package installs the we executable. Here is the basic usage.

$ we --environment foo.yml printenv

The YAML in foo.yml gets loaded and applied to the environment. If the value already exists in the environment, that value will be overwritten.

You can also use a directory of YAML files.

$ we --directory myenv printenv

The files will be applied to the environment in alphabetical order.

You can shorten the flags as well as mixing files and directories.

$ we -e foo.yml -d bar/ -e baz.yml printenv

Each flag will be applied in order from left to right.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

withenv-0.2.1.tar.gz (3.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page