diff --git a/script/import-all-data b/script/import-all-data index c4649c8df..9a498a8cf 100755 --- a/script/import-all-data +++ b/script/import-all-data @@ -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