CircleCI-Public / aws-ecr-orb

CircleCI orb for interacting with Amazon's Elastic Container Registry (ECR)
https://circleci.com/orbs/registry/orb/circleci/aws-ecr
MIT License
79 stars 140 forks source link

fix: fix jq command when working with an existing Docker config.json file #334

Closed ahamilton55 closed 7 months ago

ahamilton55 commented 7 months ago

Checklist

Motivation, issues

Fixes #333

The change is needed to update the ${HOME}/.docker/config.json file to with multiple ECR entries. The jq command currently fails when attempting to add a second ECR entry.

Description

Removes double quotes around the $jq_flag so that it is properly handled when it is empty. With the double quotes, the jq command is interpreting the empty string as a parameter and then failing to find the config file because of how it is parsing the flags.

I also fix the indentation of the jq command so that the staring matches the level of the if statement above it and indent the additional parts of the jq command a couple extra spaces.