From f7d21293088e6e5924da28407f77ec3caeee2f83 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 8 Oct 2020 16:39:43 -0400 Subject: [PATCH 1/3] ENH: build_pdf.sh - add shebang and make executable --- pdf_build_src/build_pdf.sh | 1 + 1 file changed, 1 insertion(+) mode change 100644 => 100755 pdf_build_src/build_pdf.sh diff --git a/pdf_build_src/build_pdf.sh b/pdf_build_src/build_pdf.sh old mode 100644 new mode 100755 index aaac2ace54..8a36f0c537 --- a/pdf_build_src/build_pdf.sh +++ b/pdf_build_src/build_pdf.sh @@ -1,3 +1,4 @@ +#!/bin/sh # Shell script that runs process_markdowns.py and pandoc_script.py in sequence to build the pdf document # prepare the copied src directory From b7da3efaf8726dceac174c731e51d70218725717 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 8 Oct 2020 16:40:05 -0400 Subject: [PATCH 2/3] ENH: build_pdf.sh - fail as soon as some command fails --- pdf_build_src/build_pdf.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pdf_build_src/build_pdf.sh b/pdf_build_src/build_pdf.sh index 8a36f0c537..43b8038456 100755 --- a/pdf_build_src/build_pdf.sh +++ b/pdf_build_src/build_pdf.sh @@ -1,6 +1,8 @@ #!/bin/sh # Shell script that runs process_markdowns.py and pandoc_script.py in sequence to build the pdf document +set -eu + # prepare the copied src directory python3 process_markdowns.py From 1e444ad769361876abda3ce6fc4e37e300d73d50 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 8 Oct 2020 16:41:43 -0400 Subject: [PATCH 3/3] ENH: build_pdf.sh - avoid cd .. by placing operation within subdir within () It makes IMHO easier to parse the code and to avoid "oops I ended up not where I wanted" --- pdf_build_src/build_pdf.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pdf_build_src/build_pdf.sh b/pdf_build_src/build_pdf.sh index 43b8038456..ff1b26df89 100755 --- a/pdf_build_src/build_pdf.sh +++ b/pdf_build_src/build_pdf.sh @@ -10,10 +10,11 @@ python3 process_markdowns.py cp pandoc_script.py header.tex cover.tex header_setup.tex src_copy/src # run pandoc_script from src_copy directory +( cd src_copy/src python3 pandoc_script.py mv bids-spec.pdf ../.. -cd ../.. +) # delete the duplicated src directory rm -rf src_copy