Skip to content

Commit

Permalink
fix: read env var RUN_MODE in scripts for CONFIG_FILE
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowHatpro committed Sep 10, 2024
1 parent a642b54 commit ce59538
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
.idea
.env
config/production.toml
config/development.toml
config/development.toml
config/default.toml
4 changes: 3 additions & 1 deletion scripts/generate_fixtures.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ if ! command -v yq &> /dev/null; then
exit 1
fi

CONFIG_FILE="../config/development.toml"
export $(grep -v '^#' ../.env | xargs)

CONFIG_FILE="../config/${RUN_MODE}.toml"

PG_HOST=$(yq -p toml -r '.database.pg_host' "$CONFIG_FILE")
PG_PORT=$(yq -p toml -r '.database.pg_port' "$CONFIG_FILE")
Expand Down
4 changes: 3 additions & 1 deletion scripts/init_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ if ! command -v yq &> /dev/null; then
exit 1
fi

CONFIG_FILE="../config/development.toml"
export $(grep -v '^#' ../.env | xargs)

CONFIG_FILE="../config/${RUN_MODE}.toml"

PG_HOST=$(yq -p toml -r '.database.pg_host' "$CONFIG_FILE")
PG_PORT=$(yq -p toml -r '.database.pg_port' "$CONFIG_FILE")
Expand Down
4 changes: 3 additions & 1 deletion scripts/reinit_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ if ! command -v yq &> /dev/null; then
exit 1
fi

CONFIG_FILE="../config/development.toml"
export $(grep -v '^#' ../.env | xargs)

CONFIG_FILE="../config/${RUN_MODE}.toml"

PG_HOST=$(yq -p toml -r '.database.pg_host' "$CONFIG_FILE")
PG_PORT=$(yq -p toml -r '.database.pg_port' "$CONFIG_FILE")
Expand Down

0 comments on commit ce59538

Please sign in to comment.