Skip to content

Commit f8a1033

Browse files
authored
Update build.sh (#77)
* Update build.sh We can fail to copy the input file if it's not in the root directory of the repo (e.g., `cp: cannot create regular file '/tmp/tmp.sRqO7Yhj5L/dpe-irot-profile/main.md': No such file or directory`). Make the missing directory before copying. * also make dirs for outputs
1 parent 99d301f commit f8a1033

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

build.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ if [ "${table_rules}" == "yes" ]; then
256256
extra_pandoc_options+=" --lua-filter=table-rules.lua"
257257
fi
258258

259+
mkdir -p "${build_dir}/$(dirname ${input_file})"
259260
cp "${input_file}" "${build_dir}/${input_file}"
260261

261262
# Hacks
@@ -290,6 +291,7 @@ export MERMAID_FILTER_FORMAT="pdf"
290291

291292
# Generate the pdf
292293
if [ -n "${pdf_output}" ]; then
294+
mkdir -p "$(dirname ${pdf_output})"
293295
echo "Generating PDF Output"
294296
# workaround to make mermaid and crossref play nice together: https://github.com/raghur/mermaid-filter/issues/39#issuecomment-1703911386
295297
pandoc \
@@ -335,6 +337,7 @@ fi
335337

336338
# Generate the LaTeX output
337339
if [ -n "${latex_output}" ]; then
340+
mkdir -p "$(dirname ${latex_output})"
338341
echo "Generating LaTeX Output"
339342
# workaround to make mermaid and crossref play nice together: https://github.com/raghur/mermaid-filter/issues/39#issuecomment-1703911386
340343
pandoc \
@@ -380,6 +383,7 @@ fi
380383

381384
# Generate the docx output
382385
if [ -n "${docx_output}" ]; then
386+
mkdir -p "$(dirname ${docx_output})"
383387
echo "Generating DOCX Output"
384388
# workaround to make mermaid and crossref play nice together: https://github.com/raghur/mermaid-filter/issues/39#issuecomment-1703911386
385389
pandoc \
@@ -417,6 +421,7 @@ export MERMAID_FILTER_FORMAT="svg"
417421

418422
# Generate the html output
419423
if [ -n "${html_output}" ]; then
424+
mkdir -p "$(dirname ${html_output})"
420425
echo "Generating html Output"
421426
# workaround to make mermaid and crossref play nice together: https://github.com/raghur/mermaid-filter/issues/39#issuecomment-1703911386
422427
pandoc \

0 commit comments

Comments
 (0)