@@ -12,128 +12,121 @@ export RUST_LOG := log
1212
1313# watch filesystem for changes and rerun tests
1414watch + ARGS = ' test':
15- cargo watch --clear --exec ' {{ ARGS}} '
15+ cargo watch --clear --exec ' {{ ARGS}} '
1616
1717# show stats about torrents at `PATH`
1818stats PATH :
19- cargo build --release
20- time ./ target/ release/ imdl --unstable torrent stats --input {{ PATH}}
19+ cargo build --release
20+ time ./ target/ release/ imdl --unstable torrent stats --input {{ PATH}}
2121
2222push :
23- ! git branch | grep ' * master'
24- git push github
23+ ! git branch | grep ' * master'
24+ git push github
2525
2626# clean up feature branch BRANCH
2727done BRANCH = ` git rev-parse --abbrev-ref HEAD ` :
28- git push github {{ BRANCH}} :master
29- git rebase github/ master master
30- git branch -d {{ BRANCH}}
28+ git push github {{ BRANCH}} :master
29+ git rebase github/ master master
30+ git branch -d {{ BRANCH}}
3131
3232test :
33- cargo test --all
33+ cargo test --all
3434
3535clippy :
36- cargo clippy --all-targets --all-features
36+ cargo clippy --all-targets --all-features
3737
3838fmt :
39- cargo + nightly fmt --all
39+ cargo + nightly fmt --all
4040
4141forbid :
42- ./ bin/ forbid
42+ ./ bin/ forbid
4343
4444preview-readme :
45- grip -b README.md
45+ grip -b README.md
4646
4747# build and serve the book
4848book :
49- mdbook serve book --open --dest-dir ../ www/ book
49+ mdbook serve book --open --dest-dir ../ www/ book
5050
5151dev-deps :
52- brew install grip
53- cargo install mdbook
54- cargo install cargo-watch
55- npm install --global asciicast2gif
56- brew install imagemagick
57- brew install gifsicle
52+ brew install grip
53+ cargo install mdbook
54+ cargo install cargo-watch
55+ npm install --global asciicast2gif
56+ brew install imagemagick
57+ brew install gifsicle
5858
5959# update generated documentation
6060gen :
61- cargo build
62- cargo run --package gen -- --bin target/ debug/ imdl all
61+ cargo build
62+ cargo run --package gen -- --bin target/ debug/ imdl all
6363
6464check-minimal-versions :
65- ./ bin/ check-minimal-versions
65+ ./ bin/ check-minimal-versions
6666
6767check : test clippy forbid check-minimal-versions gen
68- git diff --no-ext-diff --quiet --exit-code
69- cargo + nightly fmt --all -- --check
68+ git diff --no-ext-diff --quiet --exit-code
69+ cargo + nightly fmt --all -- --check
7070
7171draft : push
72- hub pull-request -o --draft
72+ hub pull-request -o --draft
7373
7474pr : check push
75- hub pull-request -o
76-
77- merge BRANCH = ` git rev-parse --abbrev-ref HEAD ` :
78- #!/usr/bin/env bash
79- set -euxo pipefail
80- while ! hub ci-status --verbose {{ BRANCH}} ; do
81- sleep 5
82- done
83- just done {{ BRANCH}}
84-
85- publish-check : check
86- cargo outdated --exit-code 1
87- grep ' ^\[{{ version}} \]' target/ gen/ CHANGELOG.md
88-
89- publish BRANCH = ` git rev-parse --abbrev-ref HEAD ` : publish-check (merge BRANCH)
90- #!/usr/bin/env bash
91- set -euxo pipefail
92- git tag -a {{ version}} -m ' Release {{ version}} '
93- git push github {{ version}}
94- while ! hub ci-status --verbose {{ BRANCH}} ; do
95- sleep 5
96- done
97- cargo publish
75+ hub pull-request -o
76+
77+ publish :
78+ #!/usr/bin/env bash
79+ set -euxo pipefail
80+ rm -rf tmp/ release
81+ git clone git@github.com:casey/ intermodal.git tmp/ release
82+ cd tmp/ release
83+ cargo build
84+ cargo run --package gen -- --bin target/ debug/ imdl all
85+ VERSION=v` sed -En ' s/version[[:space:]]*=[[:space:]]*"([^"]+)"/\1/p' Cargo.toml | head -1 `
86+ git tag -a $VERSION -m " Release $VERSION"
87+ git push origin $VERSION
88+ cargo publish
89+ cd ../ ..
90+ rm -rf tmp/ release
9891
9992# record, upload, and render demo animation
10093demo : demo-record demo-upload demo-render
10194
10295demo-record :
103- #!/usr/bin/env bash
104- set -euxo pipefail
105- cargo build --release --all
106- rm -f tmp/ 9 front.torrent
107- asciinema rec \
108- - -title " Intermodal {{ version}} Demo" \
109- - -command ./ target/ release/ demo \
110- - -overwrite \
111- tmp/ demo.json
96+ #!/usr/bin/env bash
97+ set -euxo pipefail
98+ cargo build --release --all
99+ rm -f tmp/ 9 front.torrent
100+ asciinema rec \
101+ - -title " Intermodal {{ version}} Demo" \
102+ - -command ./ target/ release/ demo \
103+ - -overwrite \
104+ tmp/ demo.json
112105
113106demo-upload :
114- asciinema upload tmp/ demo.json
107+ asciinema upload tmp/ demo.json
115108
116109demo-render :
117- ../ asciicast2gif/ asciicast2gif -S4 tmp/ demo.json www/ demo.gif
110+ ../ asciicast2gif/ asciicast2gif -S4 tmp/ demo.json www/ demo.gif
118111
119112# print commit metadata types
120113commit-types :
121- cargo run --package gen -- --bin target/ debug/ imdl commit-types
114+ cargo run --package gen -- --bin target/ debug/ imdl commit-types
122115
123116# open site index
124117www :
125- open www/ index.html
118+ open www/ index.html
126119
127120# retrieve large collection of torrents from the Internet Archive
128121get-torrents :
129- aria2c \
130- - d dat \
131- - x 10 \
132- ' https://ia802701.us.archive.org/21/items/2014_torrent_archive_organized/torrent_archive_organized.zip'
122+ aria2c \
123+ - d dat \
124+ - x 10 \
125+ ' https://ia802701.us.archive.org/21/items/2014_torrent_archive_organized/torrent_archive_organized.zip'
133126
134127# download bittorrent.org repository
135128get-beps :
136- git clone git@github.com:bittorrent/ bittorrent.org.git tmp/ bittorrent.org
129+ git clone git@github.com:bittorrent/ bittorrent.org.git tmp/ bittorrent.org
137130
138131build-image :
139132 podman build -t imdl .
0 commit comments