-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjustfile
54 lines (41 loc) · 1.74 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
set dotenv-load := false
export NOW := `date "+%Y-%m-%d"`
export NOWDT := `date "+%Y-%m-%dT%H-%M"`
default:
@just --list
new_jsons:
for x in item class specialization skill pet monster quest npc; do curl -X POST https://orna.guide/api/v1/${x} -d "{}" | jq . > data/current_entries/${x}.json
cp -r data/current_entries data/current_entries-${NOW}
cd data && BZIP2=-9 tar -cjvf current_entries-${NOW}{.tar.bz2,}
mv data/current_entries-${NOW}.tar.bz2 data/backups/current_entries/
rm -r data/current_entries-${NOW}
backup_htmls:
mv data/htmls data/htmls-${NOW}
cd data && BZIP2=-9 tar -cjvf htmls-${NOW}{.tar.bz2,}
mv data/htmls-${NOW}.tar.bz2 data/backups/htmls
mv data/htmls-${NOW} data/htmls
backup_current_entries:
cargo run --release --bin ethi json refresh
cp -r data/current_entries data/current_entries-${NOW}
cd data && BZIP2=-9 tar -cjvf current_entries-${NOW}{.tar.bz2,}
mv data/current_entries-${NOW}.tar.bz2 data/backups/current_entries
rm -r data/current_entries-${NOW}
json_refresh:
cargo run --release --bin ethi json refresh
backup_htmls_now:
mv data/htmls data/htmls-${NOWDT}
cd data && BZIP2=-9 tar -cjvf htmls-${NOWDT}{.tar.bz2,}
mv data/htmls-${NOWDT}.tar.bz2 data/backups/htmls
mv data/htmls-${NOWDT} data/htmls
backup_current_entries_now:
cp -r data/current_entries data/current_entries-${NOWDT}
cd data && BZIP2=-9 tar -cjvf current_entries-${NOWDT}{.tar.bz2,}
mv data/current_entries-${NOWDT}.tar.bz2 data/backups/current_entries
rm -r data/current_entries-${NOWDT}
merge:
cargo run --release --bin ethi backups merge
quick_merge_now: backup_current_entries_now merge
new_merge_now: json_refresh quick_merge_now
cron: new_jsons backup_htmls backup_current_entries
t:
echo current_entries-${NOW}