Skip to content

JonShort/cenv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cenv - environment variable file changer

Continuous integration

usage

Using a comment pattern in your .env files, easily swap between envs in local development.

Installation

macOS

Install via. homebrew

  1. Connect to the cenv tap
brew tap jonshort/cenv
  1. Install cenv from the tap
brew install cenv

Windows

  1. Download the latest binary from the releases page

  2. Decide if you want to execute the binary directly, or using an environment variable

Usage

  1. Add the "cenv" pattern to your .env file
VARIABLE_1=something

# ++ local ++
# API_ADDRESS=http://localhost:5000
# REQUIRE_LOGIN=false

# ++ live ++
# API_ADDRESS=https://myliveapi.com
# REQUIRE_LOGIN=true
  1. Run cenv, choosing an env keyword to use
cenv live
  1. Check your .env, the keyworded env vars will now be uncommented
VARIABLE_1=something

# ++ local ++
# API_ADDRESS=http://localhost:5000
# REQUIRE_LOGIN=false

# ++ live ++
API_ADDRESS=https://myliveapi.com
REQUIRE_LOGIN=true

Releasing a new version

  1. Ensure CHANGELOG.md is updated on main branch
  2. Push a tag to origin matching the version referenced in the changelog
  3. Follow the instructions in homebrew-cenv to ensure the new version is available via. homebrew