Skip to content

Instantly share code, notes, and snippets.

@pwm
Created March 4, 2016 14:33
Show Gist options
  • Save pwm/491dc2efc81c50dc75bd to your computer and use it in GitHub Desktop.
Save pwm/491dc2efc81c50dc75bd to your computer and use it in GitHub Desktop.
Turning plantuml .puml files to .svg
#!/usr/bin/env bash
PUML_RELATIVE_WORKING_DIR="diagrams/"
PUML_BIN=$(which plantuml 2>/dev/null)
########
set -u # exit on unset var
set -e # exit on non-true return value
cd $(dirname ${BASH_SOURCE[0]})/.. # change to project root for relative paths
if [ -z "${PUML_BIN}" ]; then
echo "You need plantuml for this script."
echo "On a mac with homebrew: brew install plantuml"
exit
fi
echo "Turning .puml files to .svg in ${PUML_RELATIVE_WORKING_DIR} ..."
${PUML_BIN} -tsvg -o . ${PUML_RELATIVE_WORKING_DIR}*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment