2020-07-10 23:11:07 -06:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#!/usr/bin/env bash
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# Convert .bob and .msc files in docs/art to .svg files located where the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# site build will find them.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								set -e
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								cd "$(dirname "$0")"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								output_dir=static/img
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								mkdir -p "$output_dir"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								while read -r bob_file; do
							 | 
						
					
						
							
								
									
										
										
										
											2020-07-15 15:35:18 -06:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  out_file=$(basename "${bob_file%.*}".svg)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  svgbob "$bob_file" --output "$output_dir/$out_file"
							 | 
						
					
						
							
								
									
										
										
										
											2020-07-10 23:11:07 -06:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								done < <(find art/*.bob)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								while read -r msc_file; do
							 | 
						
					
						
							
								
									
										
										
										
											2020-07-15 15:35:18 -06:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  out_file=$(basename "${msc_file%.*}".png)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  mscgen -T png -o "$output_dir/$out_file" -i "$msc_file"
							 | 
						
					
						
							
								
									
										
										
										
											2020-07-10 23:11:07 -06:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								done < <(find art/*.msc)
							 |