Skip to content

Commit

Permalink
fix: Remove jq dependency (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
bharathkkb authored Jul 28, 2020
1 parent 7f08398 commit bf68ab8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/check_components.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ GCLOUD_PATH=$1
PROPOSED_COMPONENTS_TO_INSTALL=$2

# get list of currently installed components
CURRENTLY_INSTALLED=$($GCLOUD_PATH components list --quiet --format json 2> /dev/null | jq -r '[.[] | select(.state.name!="Not Installed") | .id] | @tsv | gsub("\\t";",")')

CURRENTLY_INSTALLED=$($GCLOUD_PATH components list --quiet --filter='state.name!="Not Installed"' --format="csv[no-heading,terminator=','](id)" 2> /dev/null)
# this creates a trailing comma that needs to be removed
CURRENTLY_INSTALLED=${CURRENTLY_INSTALLED%?}
# transform to arrays
IFS=',' read -r -a CURRENTLY_INSTALLED <<< "$CURRENTLY_INSTALLED"
IFS=',' read -r -a PROPOSED_COMPONENTS_TO_INSTALL <<< "$PROPOSED_COMPONENTS_TO_INSTALL"
Expand Down

0 comments on commit bf68ab8

Please sign in to comment.