From 27070f9f054775c9f62f33c72c317fcd1d1176d3 Mon Sep 17 00:00:00 2001 From: Jim Hague Date: Wed, 6 Dec 2017 22:51:46 +0000 Subject: [PATCH] Allow bookes to be build individually but omitted from Bumper Booke. --- makeAll.sh | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/makeAll.sh b/makeAll.sh index 37ad860..2e8aa88 100755 --- a/makeAll.sh +++ b/makeAll.sh @@ -1,8 +1,11 @@ #!/bin/bash # # Build all forms of the Booke. +# +# Arguments are the names of the bookes to build. If a name is +# prefixed '-', then do not include that section in the Bumper Booke. -if [ $# -lt 1 ]; then +if [[ $# -lt 1 ]]; then echo "Usage: makeAll.sh [ ...]" exit 1 fi @@ -70,11 +73,24 @@ makeBumperBooke() ./makeBooklet.sh "Bumper" } +declare buildBookes +declare bumperBookes + for booke in "$@" +do + if [[ ${booke:0:1} = "-" ]]; then + booke=${booke/#-/} + else + bumperBookes+=("$booke") + fi + buildBookes+=("$booke") +done + +for booke in "${buildBookes[@]}" do makeASingleBooke $booke done -if [ $# -gt 1 ]; then - makeBumperBooke "$@" +if [[ ${#bumperBookes[@]} -gt 1 ]]; then + makeBumperBooke "${bumperBookes[@]}" cp Bumper*.pdf ./web fi