<commit_before>#!/bin/sh

nx_conf=/etc/nginx/nginx.conf

# update the auth token
auth=$(grep  X-Forwarded-User ${nx_conf} | awk '{print $4}'| uniq|tr -d "\n\r")
if [ "$REGISTRY_ID" = "" ]
then 
    token=$(aws ecr get-login --no-include-email | awk '{print $6}')
else
    aws_cli_exec=$(aws ecr get-login --no-include-email --registry-ids $REGISTRY_ID)
fi
auth_n=$(echo AWS:${token}  | base64 |tr -d "[:space:]")

sed -i "s|${auth%??}|${auth_n}|g" ${nx_conf}
<commit_msg>fix for https://github.com/catalinpan/aws-ecr-proxy/issues/7, registry ID not being used to renew token<commit_after>#!/bin/sh

nx_conf=/etc/nginx/nginx.conf

# update the auth token
auth=$(grep  X-Forwarded-User ${nx_conf} | awk '{print $4}'| uniq|tr -d "\n\r")
if [ "$REGISTRY_ID" = "" ]
then
    token=$(aws ecr get-login --no-include-email | awk '{print $6}')
else
    token=$(aws ecr get-login --no-include-email --registry-ids $REGISTRY_ID | awk '{print $6}')
fi
auth_n=$(echo AWS:${token}  | base64 |tr -d "[:space:]")

sed -i "s|${auth%??}|${auth_n}|g" ${nx_conf}

{'fraction_non_alphanumeric': 0.2195589645254075, 'fraction_numerical': 0.009587727708533078, 'mean_word_length': 4.092682926829268, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6777107', 'n_tokens_mistral': 438, 'n_tokens_neox': 423, 'n_words': 99}