From 32ff5f9616318c2422a420862e11ae32ea6dc39b Mon Sep 17 00:00:00 2001 From: Jacob Yeager Date: Mon, 30 Sep 2024 16:33:28 -0400 Subject: [PATCH] USAGOV-1761-cf-components-audit: fixed uniary operator error --- bin/cloudgov/audit/cf-components | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cloudgov/audit/cf-components b/bin/cloudgov/audit/cf-components index 57adaeb321..c30104061c 100755 --- a/bin/cloudgov/audit/cf-components +++ b/bin/cloudgov/audit/cf-components @@ -95,7 +95,7 @@ echo "$ORGIDS" | jq -r '.[]' | while read -r ORGID; do if [ $spaces == "all" ]; then SPACEPAGES=cf curl "/v3/spaces" | jq -r '.pagination | .total_pages'; - if [ $SPACEPAGES -gt 1 ]; then + if [[ $SPACEPAGES -gt 1 ]]; then for i in $SPACEPAGES; do SPACEIDS=$(cf curl "/v3/spaces?page=$i&per_page=50" | jq -r '.resources[] | select( .relationships.organization.data.guid == "'$ORGID'" ) | .guid') done @@ -104,7 +104,7 @@ echo "$ORGIDS" | jq -r '.[]' | while read -r ORGID; do fi else SPACEPAGES=cf curl "/v3/spaces" | jq -r '.pagination | .total_pages'; - if [ $SPACEPAGES -gt 1 ]; then + if [[ $SPACEPAGES -gt 1 ]]; then for i in $SPACEPAGES; do SPACEIDS=$(cf curl "/v3/spaces?page=$i&per_page=50" | jq -r '.resources[] | select( .relationships.organization.data.guid == "'$ORGID'" ) | .guid' | while read -r SPACEID; do SPACENAME=$(cf curl "/v3/spaces/$SPACEID" | jq -r '.name')