Skip to content

Commit

Permalink
racers
Browse files Browse the repository at this point in the history
  • Loading branch information
nalbam committed Apr 6, 2020
1 parent 97ac027 commit d5faee2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
4 changes: 1 addition & 3 deletions racers.json
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
{
"racers": []
}
[]
14 changes: 7 additions & 7 deletions report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,31 +76,31 @@ _load() {
_racer() {
RACER=$1

USERNAME=

RACERS=${SHELL_DIR}/racers.json

if [ -f ${RACERS} ]; then
USERNAME="$(cat ${RACERS} | jq -r --arg RACER "${RACER}" '.racers[] | select(.racername==$RACER) | "\(.username)"')"
USERNAME="$(cat ${RACERS} | jq -r --arg RACER "${RACER}" '.[] | select(.racername==$RACER) | "\(.username)"')"

if [ "${USERNAME}" != "" ]; then
RACER="${RACER} @${USERNAME}"
fi
fi

RACER="${RACER} :tada:"

# return ${USERNAME}
}

_build() {
LEAGUE=$1
SEASON=$2

CHANGED=

_command "_build ${LEAGUE} ${SEASON} ..."

MESSAGE=${SHELL_DIR}/build/slack_message-${LEAGUE}.json

CHANGED=

MAX_IDX=20
if [ "${LEAGUE}" == "h2h" ]; then
MAX_IDX=32
Expand Down Expand Up @@ -169,8 +169,8 @@ _run() {
| jq -r '.[] | "\(.league) \(.season)"' \
> ${LIST}

while read VAL; do
ARR=(${VAL})
while read LINE; do
ARR=(${LINE})

_load ${ARR[0]} ${ARR[1]}
_build ${ARR[0]} ${ARR[1]}
Expand Down

0 comments on commit d5faee2

Please sign in to comment.