Skip to content

Instantly share code, notes, and snippets.

@mathew-hall
Last active October 16, 2015 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mathew-hall/1078089b1afb9f50e957 to your computer and use it in GitHub Desktop.
Save mathew-hall/1078089b1afb9f50e957 to your computer and use it in GitHub Desktop.
Angular Dependency Graphviz
#!/usr/bin/env bash
(echo "digraph g{"; grep -rh module js | grep -v '[\S+]' | sed 's/.*module(//;' | tr -d " (')[];" | tr , " " | awk '{if($1!="" && $1 != " "){for(i = 2; i <= NF; i++){ print "\"",$1,"\"","->", "\"",$i,"\""; }}}'; echo "}") > /tmp/deps.dot
dot -Tpdf /tmp/deps.dot -o/tmp/deps.pdf && open /tmp/deps.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment