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

@@ -1,3 +0,0 @@
Council,Ward,Candidate Name,Rating
Brimbank,Harvester,Joe Blogs,1
Brimbank,Harvester,Jane Doe,5
1 Council Ward Candidate Name Rating
2 Brimbank Harvester Joe Blogs 1
3 Brimbank Harvester Jane Doe 5

View File

@@ -0,0 +1,3 @@
Council,Ward,Candidate Name,Rating
Greater Geelong,Kardinia,Joe Blogs,1
Greater Geelong,You Yangs,Jane Doe,5
1 Council Ward Candidate Name Rating
2 Greater Geelong Kardinia Joe Blogs 1
3 Greater Geelong You Yangs Jane Doe 5

View File

@@ -10,6 +10,10 @@
# The "wardNames" field must be a list of strings. # The "wardNames" field must be a list of strings.
COUNCILS_FILE="council_names.json" 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. # Controls the flags that are passed to every usage of the wp command.
WP_FLAGS="--allow-root --path=/var/www/html" WP_FLAGS="--allow-root --path=/var/www/html"
@@ -21,7 +25,7 @@ function create_or_update_page() {
slug=$(echo "$council_block" | jq -r '.slug') 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 if [ $? -eq 0 ]; then