Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add direnv support with boilerplate #2175

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# shellcheck shell=bash
# This is an example of a .env file
export GOMAXPROCS=6
export KO_DOCKER_REPO=gcr.io/tektoncd/pipeline
18 changes: 18 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# shellcheck shell=bash

# If .env missing; restore from .env.sample and validate
# See https://github.com/direnv/direnv/wiki/.envrc-Boilerplate
if [[ -f .env.sample ]]; then
if [[ ! -f .env ]]; then
if ! command -v createnv > /dev/null; then
echo 'WARN|Createnv missing; try: pyenv local 3.x && pip install createnv'
else
createnv --use-default --overwrite || echo 'ERROR|https://github.com/cuducos/createnv'
if command dotenv-linter --version >&/dev/null; then
dotenv-linter .env || echo 'ERROR|https://dotenv-linter.github.io'
fi
fi
fi
fi

dotenv_if_exists || direnv status # https://direnv.net/man/direnv-stdlib.1.html
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ tags
*.nupkg

.bin
.env
Loading