From 9e0b434430021873d8283da79802f728422ef558 Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Sun, 19 May 2024 21:35:02 +0100 Subject: [PATCH] fix: port some ideas across to teh minutes script --- _scripts/format_minutes.sh | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/_scripts/format_minutes.sh b/_scripts/format_minutes.sh index f3b4c79..6018204 100755 --- a/_scripts/format_minutes.sh +++ b/_scripts/format_minutes.sh @@ -2,14 +2,17 @@ root="$PWD" +folder_html="Minutes_html" +folder_pdf="Minutes_pdf" + # make teh html files first function build_html() { # wipe and reset teh old html folder - rm -rf Minutes_html - mkdir Minutes_html + rm -rf "$folder_html" + mkdir "$folder_html" # this folder has css and images needed - cp -R Minutes/_Templates Minutes_html/ + cp -R Minutes/_Templates "$folder_html/" cd Minutes @@ -37,14 +40,14 @@ function build_html() { rm -f .md.toml # create teh new folders where stuff is going to - mkdir -p "../../Minutes_html/$year/Committee" - mkdir -p "../../Minutes_html/$year/Council" + mkdir -p "../../$folder_html/$year/Committee" + mkdir -p "../../$folder_html/$year/Council" # iterate the files for file in {Committee,Council}_html/*.html; do if [ -f "$file" ]; then stripped=''${file/_html/""} - cp $file "../../Minutes_html/$year/$stripped" + cp $file "../../$folder_html/$year/$stripped" fi done # the temp folders where teh html was created, leaving these could cause ghost artifacts @@ -63,22 +66,17 @@ function build_pdf() { shopt -s globstar # wipe and reset past runs - rm -rf Minutes_pdf - mkdir Minutes_pdf + rm -rf "$folder_pdf" + mkdir "$folder_pdf" - cd Minutes_html + cd "$folder_html" for file in **/*.html; do - # skip teh template folder - if [[ $file == *"_Templates"* ]]; then - continue - fi - # only deal with files if [ -f "$file" ]; then # .html => .pdf - output="../Minutes_pdf/${file/.html/".pdf"}" + output="../$folder_pdf/${file/.html/".pdf"}" echo $output