Skip to content

Commit

Permalink
Follow shell conventions for variable naming
Browse files Browse the repository at this point in the history
  • Loading branch information
samwestmoreland committed Sep 29, 2023
1 parent f7383b5 commit 7892322
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions docs/plugins/lint_plugin_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,32 @@
# This script gets the latest tags for each of our first class plugin repos
# It is intended to be run by a github action

PLUGINS=("python" "java" "go" "cc" "shell" "go-proto" "proto")
URLPREFIX="https://github.com/please-build/"
plugins=("python" "java" "go" "cc" "shell" "go-proto" "proto")
url_prefix="https://github.com/please-build/"

FAILED=0
for PLUGIN in "${PLUGINS[@]}"; do
LATEST=$(git ls-remote --tags "${URLPREFIX}""${PLUGIN}"-rules.git | sed 's/.*\///' | sed '/^v[0-9]\+\.[0-9]\+\.[0-9]\+$/!d' | tail -n 1)
if [ -z "$LATEST" ]; then
echo "No tags found for ${PLUGIN}"
failed=0
for plugin in "${plugins[@]}"; do
latest=$(git ls-remote --tags "${url_prefix}""${plugin}"-rules.git | sed 's/.*\///' | sed '/^v[0-9]\+\.[0-9]\+\.[0-9]\+$/!d' | tail -n 1)
if [ -z "$latest" ]; then
echo "No tags found for ${plugin}"
exit 1
fi

DOCS_VERSION=$(./pleasew query print //docs/... --include "${PLUGIN}"_plugin_docs* | grep labels | cut -d: -f2 | cut -d\' -f1)
if [ -z "$DOCS_VERSION" ]; then
echo "No docs found for ${PLUGIN}"
docs_version=$(./pleasew query print //docs/... --include "${plugin}"_plugin_docs* | grep labels | cut -d: -f2 | cut -d\' -f1)
if [ -z "$docs_version" ]; then
echo "No docs found for ${plugin}"
exit 1
fi

if [ "$LATEST" != "$DOCS_VERSION" ]; then
echo "Latest version for ${PLUGIN} is ${LATEST}, update the plugin version in docs/BUILD from ${DOCS_VERSION} to ${LATEST}"
FAILED=1
if [ "$latest" != "$docs_version" ]; then
echo "Latest version for ${plugin} is ${latest}, update the plugin version in docs/BUILD from ${docs_version} to ${latest}"
failed=1
continue
fi

echo "Latest version for ${PLUGIN} is ${LATEST}. Docs are up to date"
echo "Latest version for ${plugin} is ${latest}. Docs are up to date"
done

if [ $FAILED -eq 1 ]; then
if [ $failed -eq 1 ]; then
exit 1
fi

0 comments on commit 7892322

Please sign in to comment.