Skip to content

Commit 08770f8

Browse files
authored
Merge pull request #334 from ahamilton55/ah/fix-multiple-repos
fix: fix jq command when working with an existing Docker config.json file
2 parents 00f044a + 26dea5f commit 08770f8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/scripts/ecr_login.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ configure_config_json(){
3838
if [ ! -s "${CONFIG_FILE}" ]; then
3939
jq_flag="-n"
4040
fi
41-
jq "${jq_flag}" --arg url "${AWS_ECR_VAL_ACCOUNT_URL}" \
42-
--arg helper "ecr-login" '.credHelpers[$url] = $helper' \
43-
"${CONFIG_FILE}" > temp.json && mv temp.json "${CONFIG_FILE}"
41+
42+
jq ${jq_flag} --arg url "${AWS_ECR_VAL_ACCOUNT_URL}" \
43+
--arg helper "ecr-login" '.credHelpers[$url] = $helper' \
44+
"${CONFIG_FILE}" > temp.json && mv temp.json "${CONFIG_FILE}"
4445
}
4546

4647
install_aws_ecr_credential_helper(){

0 commit comments

Comments
 (0)