Skip to content

Commit f3f8d81

Browse files
committed
Add support for wave 9
Also refresh packs.json in case it is over a week old.
1 parent b57a126 commit f3f8d81

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

mcdbcli

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ init_packs() {
2020
curl -so "$PACKS_CACHE" "${MCDB_API_URL}/packs/"
2121
fi
2222

23+
local -i now=$(date '+%s')
24+
local -i cache_modified=$(date -r $PACKS_CACHE '+%s')
25+
if ((now - date > 60 * 60 * 24 * 7)); then
26+
curl -so "$PACKS_CACHE" "${MCDB_API_URL}/packs/"
27+
fi
28+
2329
local -a pack_positions=($(jq -r '.[] | @text "\(.code)=\(.position)"' <$PACKS_CACHE))
2430
export "${pack_positions[@]}"
2531
}
@@ -71,6 +77,8 @@ get_wave_number() {
7177
echo 7
7278
elif [ $pack_position -lt 50 ]; then
7379
echo 8
80+
elif [ $pack_position -lt 55 ]; then
81+
echo 9
7482
else
7583
echo 99
7684
fi

0 commit comments

Comments
 (0)