check games table for live games
This commit is contained in:
parent
e5ff87730e
commit
46148dedf6
|
@ -30,8 +30,10 @@ then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# grab most recently started live pk, if multiple
|
# grab the game pk of a single live game, if multiple (in case of spring
|
||||||
gamePk=$(mlblive schedule -t $team | jq '.dates[].games | map(select(.status.abstractGameState == "Live"))[-1].gamePk')
|
# training)
|
||||||
|
gamePk=$(sqlite3 $db "select gamePk from games where teamId='$team' and state='In Progress' limit 1")
|
||||||
|
if [[ -z "$gamePk" ]]
|
||||||
if [[ "$gamePk" = 'null' ]]
|
if [[ "$gamePk" = 'null' ]]
|
||||||
then
|
then
|
||||||
echo "$0:" 'no live games found' >&2
|
echo "$0:" 'no live games found' >&2
|
||||||
|
|
|
@ -30,9 +30,10 @@ then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# grab most recently started live pk, if multiple
|
# grab the game pk of a single live game, if multiple (in case of spring
|
||||||
gamePk=$(mlblive schedule -t $team | jq '.dates[].games | map(select(.status.abstractGameState == "Live"))[-1].gamePk')
|
# training)
|
||||||
if [[ "$gamePk" = 'null' ]]
|
gamePk=$(sqlite3 $db "select gamePk from games where teamId='$team' and state='In Progress' limit 1")
|
||||||
|
if [[ -z "$gamePk" ]]
|
||||||
then
|
then
|
||||||
echo "$0:" 'no live games found' >&2
|
echo "$0:" 'no live games found' >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in New Issue