Skip to content

Commit 26dea5f

Browse files
committed
fix: fix jq command when working with an existing Docker config.json file
1 parent 00f044a commit 26dea5f

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)