From e6f6a8a1b42d2c01bc52c1f39d3a43f9f8f8ff15 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 1 Mar 2022 00:58:29 +0000 Subject: [PATCH] docs: resolve svgbob binary (#23399) (cherry picked from commit 5877e38baadedb8f63d84856348c28cd29b6a2d1) Co-authored-by: Trent Nelson --- docs/convert-ascii-to-svg.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/convert-ascii-to-svg.sh b/docs/convert-ascii-to-svg.sh index 8c3edc4933d270..f5abd7b229f4a4 100755 --- a/docs/convert-ascii-to-svg.sh +++ b/docs/convert-ascii-to-svg.sh @@ -8,11 +8,17 @@ set -e cd "$(dirname "$0")" output_dir=static/img +svgbob_cli="$(command -v svgbob_cli || true)" +if [[ -z "$svgbob_cli" ]]; then + svgbob_cli="$(command -v svgbob || true)" + [[ -n "$svgbob_cli" ]] || ( echo "svgbob_cli binary not found" && exit 1 ) +fi + mkdir -p "$output_dir" while read -r bob_file; do out_file=$(basename "${bob_file%.*}".svg) - svgbob "$bob_file" --output "$output_dir/$out_file" + "$svgbob_cli" "$bob_file" --output "$output_dir/$out_file" done < <(find art/*.bob) while read -r msc_file; do