Skip to content

Commit

Permalink
Add option to skip dotenv files recreation when just up runs (#5191)
Browse files Browse the repository at this point in the history
  • Loading branch information
krysal authored Nov 27, 2024
1 parent 62ee7a8 commit be9481d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
7 changes: 3 additions & 4 deletions env.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Catalog
AIRFLOW_PORT=9090
AWS_ACCESS_KEY=test_key
AWS_SECRET_KEY=test_secret
# DC_USER=opener

# SKIP_DOTENV_FILES_RECREATION=true
9 changes: 7 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set dotenv-load := false
set dotenv-load := true

# Meaning of Just prefixes:
# @ - Quiet recipes (https://github.com/casey/just#quiet-recipes)
Expand Down Expand Up @@ -209,7 +209,12 @@ _env src dest:
dest_file.write(f"{key}={value}\n")

# Create .env files from templates
@env:
env:
#!/usr/bin/env sh
if {{ env_var_or_default("SKIP_DOTENV_FILES_RECREATION", "false") }} ; then
echo "Skipping .env files (re)creation."
exit 0
fi
# Root
just _env env.template .env
# Docker
Expand Down

0 comments on commit be9481d

Please sign in to comment.