Move candidate csv into a folder named after the council

This commit is contained in:
2024-08-11 20:42:36 +10:00
parent 9d5ba8bd38
commit 4d9d633676
4 changed files with 8 additions and 4 deletions

View File

@@ -10,6 +10,10 @@
# The "wardNames" field must be a list of strings.
COUNCILS_FILE="council_names.json"
# The folder containing data for each council.
# Includes the list of candidates and any media.
DATA_PATH="data"
# Controls the flags that are passed to every usage of the wp command.
WP_FLAGS="--allow-root --path=/var/www/html"
@@ -21,7 +25,7 @@ function create_or_update_page() {
slug=$(echo "$council_block" | jq -r '.slug')
content=$(echo "$council_block" | jq -c | php php-template/main.php --council-file "php://stdin" --candidates-file "candidates/$slug.csv")
content=$(echo "$council_block" | jq -c | php php-template/main.php --council-file "php://stdin" --candidates-file "$DATA_PATH/$slug/candidates.csv)
if [ $? -eq 0 ]; then