Last active
November 2, 2020 21:47
-
-
Save tbrisbout/445530ff71be0d33cfde49761057b3e0 to your computer and use it in GitHub Desktop.
build diagrams
This file contains 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 | |
# To run like this: | |
# ./run.sh foo.py | |
# | |
# If you have `entr` installed, you can build and preview on change: | |
# ls *.py | entr -p ./run.sh /_ | |
# | |
set -e | |
input_file=$(basename -- "$1") | |
filename="${input_file%%.*}" | |
output_file="${filename}.png" | |
cat "$input_file" | sudo docker run --rm -i -v $PWD/out:/out gtramontina/diagrams:0.17.0 | |
xdg-open "./out/${output_file}" 2>/dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment