Skip to content

Commit

Permalink
fix: update sanity-checks.sh (#2891)
Browse files Browse the repository at this point in the history
  • Loading branch information
alicejli committed May 15, 2024
1 parent 38ebf8a commit 2bd16e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions spring-cloud-generator/scripts/generate-library-list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fi
cd ${SPRING_GENERATOR_DIR}
# start file, always override is present
filename=${SPRING_GENERATOR_DIR}/scripts/resources/library_list.txt
echo "# api_shortname, googleapis-folder, distribution_name:version, monorepo_folder" > "$filename"
echo "# library_name, googleapis_location, coordinates_version, monorepo_folder" > "$filename"

# loop through configs for the monorepo (google-cloud-java)
# Note that this logic will not work for non-cloud APIs
Expand Down Expand Up @@ -49,8 +49,8 @@ while IFS= read -r config; do
echo "release_level: $release_level"
monorepo_folder="java/${unique_module_name}"
echo "monorepo folder: $monorepo_folder"
group_id=$(echo $distribution_name | cut -f1 -d:)
artifact_id=$(echo $distribution_name | cut -f2 -d:)
group_id=$(echo $coordinates_version | cut -f1 -d:)
artifact_id=$(echo $coordinates_version | cut -f2 -d:)
# filter to in-scope libraries
if [[ $library_type != *GAPIC_AUTO* ]] ; then
echo "$d: non auto type: $library_type"
Expand Down
5 changes: 2 additions & 3 deletions spring-cloud-generator/scripts/sanity-checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,17 @@ if [[ $(cat $LIBRARY_LIST_PATH | wc -l) -lt 2 ]]; then fail "library list is emp
# checks that the contents of each entry in the library list is a string with
# length >= 1
libraries=$(cat $LIBRARY_LIST_PATH | tail -n+2)
while IFS=, read -r library_name googleapis_location coordinates_version googleapis_commitish monorepo_folder; do
while IFS=, read -r library_name googleapis_location coordinates_version monorepo_folder; do

non_empty_check_items=(
"$library_name"
"$googleapis_location"
"$coordinates_version"
"$googleapis_commitish"
"$monorepo_folder"
)
for column in "${non_empty_check_items[@]}"; do
if [[ -z $column ]]; then
echo "$library_name, $googleapis_location, $coordinates_version, $googleapis_commitish, $monorepo_folder"
echo "$library_name, $googleapis_location, $coordinates_version, $monorepo_folder"
fail "the library list entry '$library_name' has an empty required cell - see $LIBRARY_LIST_PATH"
fi
done
Expand Down

0 comments on commit 2bd16e5

Please sign in to comment.