From 37c486a16e08ef80f5107a597b392add572735a3 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Thu, 22 Jan 2026 22:22:28 -0500 Subject: add x_revision directive to footer --- scripts/build.sh | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'scripts/build.sh') diff --git a/scripts/build.sh b/scripts/build.sh index 9ab3b17..b684f54 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -5,18 +5,29 @@ desired_format=${2:-pdf} built_in_all="all" build_base_command() { - local command_builder="chordpro" + local command_builder="" local file_name=$1 local file_type=$2 + local file_path="$PWD/src/$file_name.chordpro" - command_builder="$command_builder --config=$PWD/config.json" + local x_vars=$(sed -n "s/^{\(x_.\+:.\+\)}.*/\1/p" $file_path | sed "s/:/=/") + + command_builder+=" chordpro" + command_builder+=" --config=$PWD/config.json" if [[ -f "$PWD/configs/$file_name.json" ]] ; then - command_builder="$command_builder --config=$PWD/configs/$file_name.json" + command_builder+=" --config=$PWD/configs/$file_name.json" fi - command_builder="$command_builder $PWD/src/$file_name.chordpro" - command_builder="$command_builder -o $PWD/out/$file_name.$file_type" + if [ -z "" ]; then + while IFS= read -r line; do + command_builder+=" --meta $line" + done <<< "$x_vars" + fi + + command_builder+=" -o $PWD/out/$file_name.$file_type" + + command_builder+=" $file_path" echo "" echo "Starting $file_name" -- cgit v1.2.3