forked from Computer_Society/open-goverance
fmt: format using shfmt
This commit is contained in:
parent
d4869448fb
commit
e6969ab164
2 changed files with 92 additions and 95 deletions
|
@ -15,7 +15,7 @@ rm -f .md.toml
|
||||||
|
|
||||||
# if the user only wants teh html tehn early return
|
# if the user only wants teh html tehn early return
|
||||||
if [[ $1 == "html" ]]; then
|
if [[ $1 == "html" ]]; then
|
||||||
exit 0;
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# recursively parse _Handovers_html use wkhtmltopdf to convert to pdf
|
# recursively parse _Handovers_html use wkhtmltopdf to convert to pdf
|
||||||
|
@ -23,7 +23,7 @@ cd _Handovers_html
|
||||||
|
|
||||||
out_folder="../_Handovers_pdf"
|
out_folder="../_Handovers_pdf"
|
||||||
rm -rf "$out_folder"
|
rm -rf "$out_folder"
|
||||||
for d in */ ; do
|
for d in */; do
|
||||||
# skip symlinks
|
# skip symlinks
|
||||||
[ -L "''${d%/}" ] && continue
|
[ -L "''${d%/}" ] && continue
|
||||||
# exclude teh template fodler
|
# exclude teh template fodler
|
||||||
|
@ -44,7 +44,7 @@ for d in */ ; do
|
||||||
echo "$out_folder/$stripped.pdf"
|
echo "$out_folder/$stripped.pdf"
|
||||||
|
|
||||||
# convert teh html to pdf
|
# convert teh html to pdf
|
||||||
wkhtmltopdf -q --enable-local-file-access --no-stop-slow-scripts "$stripped.html" "$out_folder/$stripped.pdf" 2>> ../errors.log &
|
wkhtmltopdf -q --enable-local-file-access --no-stop-slow-scripts "$stripped.html" "$out_folder/$stripped.pdf" 2>>../errors.log &
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
root="$PWD"
|
root="$PWD"
|
||||||
|
|
||||||
# make teh html files first
|
# make teh html files first
|
||||||
function build_html(){
|
function build_html() {
|
||||||
# wipe and reset teh old html folder
|
# wipe and reset teh old html folder
|
||||||
rm -rf Minutes_html
|
rm -rf Minutes_html
|
||||||
mkdir Minutes_html
|
mkdir Minutes_html
|
||||||
|
@ -14,7 +14,7 @@ function build_html(){
|
||||||
cd Minutes
|
cd Minutes
|
||||||
|
|
||||||
# loop through each year worth of data
|
# loop through each year worth of data
|
||||||
for year in */ ; do
|
for year in */; do
|
||||||
# skip symlinks
|
# skip symlinks
|
||||||
[ -L "''${year%/}" ] && continue
|
[ -L "''${year%/}" ] && continue
|
||||||
# exclude teh template fodler
|
# exclude teh template fodler
|
||||||
|
@ -58,8 +58,7 @@ function build_html(){
|
||||||
cd $root
|
cd $root
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function build_pdf() {
|
||||||
function build_pdf(){
|
|
||||||
# used to match **
|
# used to match **
|
||||||
shopt -s globstar
|
shopt -s globstar
|
||||||
|
|
||||||
|
@ -86,7 +85,7 @@ function build_pdf(){
|
||||||
# have someplace for it to go
|
# have someplace for it to go
|
||||||
mkdir -p $(dirname $output)
|
mkdir -p $(dirname $output)
|
||||||
|
|
||||||
wkhtmltopdf -q --enable-local-file-access --no-stop-slow-scripts "$file" "$output" 2>> ../errors.log &
|
wkhtmltopdf -q --enable-local-file-access --no-stop-slow-scripts "$file" "$output" 2>>../errors.log &
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -94,9 +93,7 @@ function build_pdf(){
|
||||||
cd $root
|
cd $root
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [[ $1 == "html" ]]; then
|
||||||
if [[ $1 == "html" ]];
|
|
||||||
then
|
|
||||||
build_html
|
build_html
|
||||||
else
|
else
|
||||||
build_html
|
build_html
|
||||||
|
|
Loading…
Reference in a new issue