Script to report on api usage.

This commit is contained in:
Jeffrey Regan
2019-10-28 14:36:59 -07:00
parent 3054d69dd9
commit f44574cf43
2 changed files with 20 additions and 17 deletions

View File

@@ -1,17 +0,0 @@
# Usage:
# ./hack/showDeps ./plugin
# ./hack/showDeps ./kustomize
function showDeps {
echo "==== begin $1 =================================="
find $1 -name "*.go" |\
xargs grep \"sigs.k8s.io/kustomize/api/ |\
sed 's|:\s"| |' |\
sed 's|"$||' |\
awk '{ printf "%60s %s\n", $2, $1 }' |\
sed 's|sigs.k8s.io/kustomize/api/||' |\
sort | uniq
echo "==== end $1 =================================="
}
showDeps $1

20
hack/whatApi.sh Executable file
View File

@@ -0,0 +1,20 @@
# Report on use of API module.
#
# Usage:
# ./hack/whatApi.sh plugin
# ./hack/whatApi.sh kustomize
function whatApi {
echo "==== begin $1 =================================="
find $1 -name "*.go" |\
xargs grep \"sigs.k8s.io/kustomize/api/ |\
sed 's|:\s"|: dummy "|' |\
sed 's|:\s\w\+\s"| |' |\
sed 's|"$||' |\
awk '{ printf "%60s %s\n", $2, $1 }' |\
sed 's|sigs.k8s.io/kustomize/api/||' |\
sort | uniq
echo "==== end $1 =================================="
}
whatApi $1