walpurgis/scripts/build_graphs.sh

25 lines
541 B
Bash
Raw Normal View History

2023-11-14 13:23:54 -07:00
#!/usr/bin/env bash
declare path=""
declare -ra fnames=( 'functions' 'global_flow' )
if [[ "$1" == -h || "$1" == --help ]]; then
cat <<HELP
Builds the digraphs for this project. Must be run from top level git directory
HELP
exit 0
elif [[ -d .git ]]; then
path="./graphviz"
elif [[ -d ../.git ]]; then
path="../graphviz"
else
cat <<HELP
Builds the digraphs for this project. Must be run from top level git directory
HELP
exit 1
fi
for name in "${fnames[@]}"; do
dot -Tsvg -o "${path}/${name}.svg" "${path}/${name}.dot"
done