Skip to content

Commit

Permalink
Fixed missing tag in usage.
Browse files Browse the repository at this point in the history
Changed tilde to /Users/donal in config path.
  • Loading branch information
byrnedo committed Aug 15, 2018
1 parent b9519fe commit 1fe5554
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docker_reg_tool
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function usage {
/$ $CMD https://registry.my.domain list some-repo
Delete tag for a repo
/$ $CMD https://registry.my.domain delete some-repo
/$ $CMD https://registry.my.domain delete some-repo some-tag
EOU
Expand All @@ -49,8 +49,10 @@ ACTION="$1"
shift

CREDS=""
if [[ -f "~/.docker/config.json" ]]; then
CREDS="Authorization: Basic $(jq -r '.auths."'$REG'".auth' < ~/.docker/config.json)"
DOCKER_CONFIG="$HOME/.docker/config.json"

if [[ -f "$DOCKER_CONFIG" ]]; then
CREDS="Authorization: Basic $(jq -r '.auths."'$REG'".auth' < "$DOCKER_CONFIG")"
elif [[ -v "BASIC_AUTH" ]]; then
CREDS="Authorization: Basic $(echo -n $BASIC_AUTH|base64)"
fi
Expand Down

0 comments on commit 1fe5554

Please sign in to comment.