Move pledge data parsing to separate file.

This commit is contained in:
Kim Taylor
2024-09-17 22:02:09 +10:00
parent 0f89ddf779
commit 1412c268b5
6 changed files with 179 additions and 103 deletions

19
make-pledge-page.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
# This script uses the jq, wp, and php commands, make sure they are installed before running this script.
# The folder containing data for each council.
# Includes the list of candidates and any media.
DATA_PATH="../spl-data"
# Iterate over folders in data path
candidates_files=()
for folder in "$DATA_PATH"/*; do
if test -f "$folder"/candidates.csv; then
candidates_files+=("$folder"/candidates.csv)
fi
done
content=$(php pledge-update/pledge-page.php --candidates-files "${candidates_files[*]}")
echo $content;