Browse Source

docs: resolve svgbob binary

Trent Nelson 3 years ago
parent
commit
5877e38baa
1 changed files with 7 additions and 1 deletions
  1. 7 1
      docs/convert-ascii-to-svg.sh

+ 7 - 1
docs/convert-ascii-to-svg.sh

@@ -8,11 +8,17 @@ set -e
 cd "$(dirname "$0")"
 cd "$(dirname "$0")"
 output_dir=static/img
 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"
 mkdir -p "$output_dir"
 
 
 while read -r bob_file; do
 while read -r bob_file; do
   out_file=$(basename "${bob_file%.*}".svg)
   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)
 done < <(find art/*.bob)
 
 
 while read -r msc_file; do
 while read -r msc_file; do