Skip to content

Commit

Permalink
fix(reset): correct syntax checking for valid fixtures
Browse files Browse the repository at this point in the history
* remove additional variable FIXTURES that isn't necessary
* remove spacing in eval, causing evaluation to fail
  • Loading branch information
thekaveman committed Feb 28, 2024
1 parent e47b6cd commit 67bc3f4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions bin/reset_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ set -ex

# whether to reset database file, defaults to true
DB_RESET="${DJANGO_DB_RESET:-true}"
# optional fixtures to import
FIXTURES="${DJANGO_DB_FIXTURES}"

if [[ $DB_RESET = true ]]; then
# construct the path to the database file from environment or default
Expand All @@ -25,11 +23,11 @@ else
echo "DB_RESET is false, skipping"
fi

valid_fixtures=$( echo $FIXTURES | grep -e fixtures\.json$ )
valid_fixtures=$(echo "$DJANGO_DB_FIXTURES" | grep -e fixtures\.json$)

if [[ -n "$valid_fixtures" ]]; then
# load data fixtures
python manage.py loaddata "$FIXTURES"
python manage.py loaddata "$DJANGO_DB_FIXTURES"
else
echo "No JSON fixtures to load"
fi

0 comments on commit 67bc3f4

Please sign in to comment.