From f44574cf4368561ce2c32132fd44e9e1faa7644f Mon Sep 17 00:00:00 2001 From: Jeffrey Regan Date: Mon, 28 Oct 2019 14:36:59 -0700 Subject: [PATCH] Script to report on api usage. --- hack/awker.sh | 17 ----------------- hack/whatApi.sh | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 17 deletions(-) delete mode 100755 hack/awker.sh create mode 100755 hack/whatApi.sh diff --git a/hack/awker.sh b/hack/awker.sh deleted file mode 100755 index 570b8a9e1..000000000 --- a/hack/awker.sh +++ /dev/null @@ -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 diff --git a/hack/whatApi.sh b/hack/whatApi.sh new file mode 100755 index 000000000..eb035d3a6 --- /dev/null +++ b/hack/whatApi.sh @@ -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