Skip to content

Instantly share code, notes, and snippets.

@textarcana

textarcana/LICENSE

Last active May 5, 2020
Embed
What would you like to do?
Bash Dependency Mapper
paths="bin/run lib/ingestion/github"
ack '\b(libexec|source)\b' $paths \
| tr -d "'" \
| tr -d '"' \
| grep -v '#\s*NOTE' \
| perl -a -F: -wlne '$F[2] =~ s{(source\s)}{};
$F[2] =~ s{.*\S+(libexec\S+).*}{$1}g;
print qq{"$F[0]" -> "$F[2]"}' \
| perl -lwpe 'BEGIN{print "digraph G {"};
s{lib/ingestion/github/graphql/}{}g;
END{print "}"};' \
> /tmp/callgraph.gv \
&& dot -Tpng /tmp/callgraph.gv -o /tmp/callgraph.png
# if it worked the image is saved to
# /tmp/callgraph.png
Copyright 2010-2019 Noah Sussman New Media, LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment