diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2026-01-22 22:22:28 -0500 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2026-01-22 22:22:28 -0500 |
| commit | 37c486a16e08ef80f5107a597b392add572735a3 (patch) | |
| tree | 9cec6c8970b56c3482ebf9b6178925a65ec076df /scripts | |
| parent | b649441e3c3e3603305f61de9e9f88e30f397736 (diff) | |
add x_revision directive to footer
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/build.sh | 21 |
1 files changed, 16 insertions, 5 deletions
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" |
