-
-
Save jbrains/4354193 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
download_yuml_image() { | |
local file="$1" | |
local output_directory="$2" | |
instructions=$(tr "\\n" "," < <(cat $file)) | |
image_basename=$(basename $(echo $file | sed -E "s/(.+)\.yuml$/\1/")) | |
image_filename="${output_directory}/${image_basename}.png" | |
wget -O "$image_filename" "http://yuml.me/diagram/plain;dir:TB/class/$instructions" | |
gm convert ${image_filename} -units PixelsPerInch -density 96x96 'xc:white' -flatten ${image_filename} | |
} | |
for file in manuscript/diagrams/class/*.yuml; do | |
download_yuml_image "$file" "manuscript/images/Design" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems weird to strip off the path's extension first, then apply
basename
. I could do that backwards.