Skip to content

Run generate_* commands in script/import-all-data #300

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
17 changes: 12 additions & 5 deletions script/import-all-data
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,21 @@ set -e
# check that we are in the expected directory
cd `dirname $0`/..

./manage.py import_areas
./manage.py import_mps
script/manage import_areas
script/manage import_mps

COMMANDS=$(find hub/management/commands/ -name 'import_*' -printf '%f\n' | sed 's#[.]py##')
GENERATE_COMMANDS=$(find hub/management/commands/ -name 'generate_*' -printf '%f\n' | sed 's#[.]py##')

for COMMAND in $COMMANDS
for COMMAND in $GENERATE_COMMANDS
do
script/manage "$COMMAND"
done

IMPORT_COMMANDS=$(find hub/management/commands/ -name 'import_*' -printf '%f\n' | sed 's#[.]py##')

for COMMAND in $IMPORT_COMMANDS
do
if [ "$COMMAND" != "import_areas" ] && [ "$COMMAND" != "import_mps" ]; then
./manage.py "$COMMAND"
script/manage "$COMMAND"
fi
done