mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-12-20 23:41:20 +00:00
Harden shell scripts
This commit is contained in:
parent
08b5d983ea
commit
f97542f9d4
1 changed files with 4 additions and 5 deletions
|
@ -7,17 +7,16 @@
|
||||||
# List of documentation files
|
# List of documentation files
|
||||||
doc_file_names=$(fd -d 1 -t f --extension adoc --exclude "README.adoc")
|
doc_file_names=$(fd -d 1 -t f --extension adoc --exclude "README.adoc")
|
||||||
|
|
||||||
for doc_file_name in $doc_file_names
|
for doc_file_name in "${doc_file_names[@]}"; do
|
||||||
do
|
|
||||||
doc_file_name_without_extension=${doc_file_name::-5}
|
doc_file_name_without_extension=${doc_file_name::-5}
|
||||||
output_path=../advlabdb/templates/docs/$doc_file_name_without_extension.html
|
output_path=../advlabdb/templates/docs/$doc_file_name_without_extension.html
|
||||||
|
|
||||||
# Convert to html with asciidoctor
|
# Convert to html with asciidoctor
|
||||||
asciidoctor -v --backend html5 $doc_file_name -o $output_path
|
asciidoctor -v --backend html5 "$doc_file_name" -o "$output_path"
|
||||||
|
|
||||||
# Add the Jinja raw tag
|
# Add the Jinja raw tag
|
||||||
sed -i "1i {% raw %}" $output_path
|
sed -i "1i {% raw %}" "$output_path"
|
||||||
echo -e "\n{% endraw %}" >> $output_path
|
echo -e "\n{% endraw %}" >>"$output_path"
|
||||||
|
|
||||||
# Done
|
# Done
|
||||||
echo "Generated $output_path"
|
echo "Generated $output_path"
|
||||||
|
|
Loading…
Reference in a new issue