-
Notifications
You must be signed in to change notification settings - Fork 25
/
justfile
156 lines (119 loc) · 3.34 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
default: watch
version := `sed -En 's/version[[:space:]]*=[[:space:]]*"([^"]+)"/v\1/p' Cargo.toml | head -1`
bt := '0'
export RUST_BACKTRACE := bt
log := 'warn'
export RUST_LOG := log
# watch filesystem for changes and rerun tests
watch +ARGS='test':
cargo watch --clear --exec '{{ARGS}}'
# show stats about torrents at `PATH`
stats PATH:
cargo build --release
time ./target/release/imdl --unstable torrent stats --input {{PATH}}
push:
! git branch | grep '* master'
git push github
# clean up feature branch BRANCH
done BRANCH=`git rev-parse --abbrev-ref HEAD`:
git push github {{BRANCH}}:master
git rebase github/master master
git branch -d {{BRANCH}}
test:
cargo test --all
clippy:
cargo clippy --all-targets --all-features
fmt:
cargo +nightly fmt --all
forbid:
./bin/forbid
preview-readme:
grip -b README.md
# build and serve the book
book:
mdbook serve book --open --dest-dir ../www/book
dev-deps:
brew install grip
cargo install mdbook
cargo install cargo-watch
npm install --global asciicast2gif
brew install imagemagick
brew install gifsicle
# update generated documentation
gen:
cargo build
cargo run --package gen -- --bin target/debug/imdl all
check-minimal-versions:
./bin/check-minimal-versions
check: test clippy forbid check-minimal-versions gen
git diff --no-ext-diff --quiet --exit-code
cargo +nightly fmt --all -- --check
draft: push
hub pull-request -o --draft
pr: check push
hub pull-request -o
publish:
#!/usr/bin/env bash
set -euxo pipefail
rm -rf tmp/release
git clone [email protected]:casey/intermodal.git tmp/release
cd tmp/release
cargo build
cargo run --package gen -- --bin target/debug/imdl all
VERSION=v`sed -En 's/version[[:space:]]*=[[:space:]]*"([^"]+)"/\1/p' Cargo.toml | head -1`
git tag -a $VERSION -m "Release $VERSION"
git push origin $VERSION
cargo publish
cd ../..
rm -rf tmp/release
# record, upload, and render demo animation
demo: demo-record demo-upload demo-render
demo-record:
#!/usr/bin/env bash
set -euxo pipefail
cargo build --release --all
rm -f tmp/9front.torrent
asciinema rec \
--title "Intermodal {{version}} Demo" \
--command ./target/release/demo \
--overwrite \
tmp/demo.json
demo-upload:
asciinema upload tmp/demo.json
demo-render:
../asciicast2gif/asciicast2gif -S4 tmp/demo.json www/demo.gif
# print commit metadata types
commit-types:
cargo run --package gen -- --bin target/debug/imdl commit-types
# open site index
www:
open www/index.html
# retrieve large collection of torrents from the Internet Archive
get-torrents:
aria2c \
-d dat \
-x 10 \
'https://ia802701.us.archive.org/21/items/2014_torrent_archive_organized/torrent_archive_organized.zip'
# download bittorrent.org repository
get-beps:
git clone [email protected]:bittorrent/bittorrent.org.git tmp/bittorrent.org
build-image:
podman build -t imdl .
podman run imdl
test-release:
-git tag -d test-release
-git push origin :test-release
git tag test-release
git push origin test-release
outdated:
cargo outdated --workspace --root-deps-only
unused:
cargo +nightly udeps --workspace
coverage:
cargo llvm-cov --html
open target/llvm-cov/html/index.html
update-changelog:
echo >> CHANGELOG.md
git log --pretty='format:- %s' >> CHANGELOG.md
update-contributors:
cargo run --release --package update-contributors