aboutsummaryrefslogtreecommitdiff
path: root/dependencies/analyses/dependency-tree.sh
diff options
context:
space:
mode:
Diffstat (limited to 'dependencies/analyses/dependency-tree.sh')
-rwxr-xr-xdependencies/analyses/dependency-tree.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/dependencies/analyses/dependency-tree.sh b/dependencies/analyses/dependency-tree.sh
new file mode 100755
index 000000000..3c9dccc51
--- /dev/null
+++ b/dependencies/analyses/dependency-tree.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/bash
+
+if test "$#" -ne 1; then
+ echo "invalid arguments: usage: $0 path to package"
+ exit 1
+fi
+
+DATA=$(go list $1/... \
+ | xargs -d '\n' go list -f '{{ .ImportPath }}: {{ join .Imports ", " }}' \
+ | awk '{ printf "%s\n\n", $0 }' \
+ )
+
+echo "$DATA"