2019-05-24 01:25:55 -07:00
|
|
|
default: watch
|
|
|
|
|
2020-01-31 01:54:46 -08:00
|
|
|
version := `sed -En 's/version[[:space:]]*=[[:space:]]*"([^"]+)"/v\1/p' Cargo.toml | head -1`
|
|
|
|
|
2020-03-31 00:01:40 -07:00
|
|
|
bt := '0'
|
2020-02-14 00:12:49 -08:00
|
|
|
|
|
|
|
export RUST_BACKTRACE := bt
|
|
|
|
|
2020-03-31 00:01:40 -07:00
|
|
|
log := 'warn'
|
2020-03-17 03:02:02 -07:00
|
|
|
|
|
|
|
export RUST_LOG := log
|
|
|
|
|
2019-05-24 01:25:55 -07:00
|
|
|
# watch filesystem for changes and rerun tests
|
2020-03-17 03:02:02 -07:00
|
|
|
watch +ARGS='':
|
|
|
|
cargo watch --clear --exec 'test {{ARGS}}'
|
2019-05-24 01:25:55 -07:00
|
|
|
|
|
|
|
# show stats about torrents at `PATH`
|
|
|
|
stats PATH:
|
|
|
|
cargo build --release
|
|
|
|
time ./target/release/imdl --unstable torrent stats --input {{PATH}}
|
|
|
|
|
2020-04-09 19:22:37 -07:00
|
|
|
push:
|
2020-02-06 00:12:07 -08:00
|
|
|
! git branch | grep '* master'
|
|
|
|
git push github
|
|
|
|
|
2020-01-04 15:09:36 -08:00
|
|
|
# clean up feature branch BRANCH
|
2020-04-09 18:23:26 -07:00
|
|
|
done BRANCH=`git rev-parse --abbrev-ref HEAD`:
|
2020-01-04 15:09:36 -08:00
|
|
|
git diff --no-ext-diff --quiet --exit-code
|
2020-04-04 02:40:41 -07:00
|
|
|
git push github {{BRANCH}}:master
|
|
|
|
git checkout master
|
|
|
|
git rebase {{BRANCH}}
|
2020-03-19 19:23:17 -07:00
|
|
|
git diff --no-ext-diff --quiet --exit-code {{BRANCH}} --
|
2020-04-04 02:40:41 -07:00
|
|
|
git branch -d {{BRANCH}}
|
2020-01-04 15:09:36 -08:00
|
|
|
|
2020-01-04 18:58:42 -08:00
|
|
|
test:
|
2020-01-31 01:54:46 -08:00
|
|
|
cargo test --all
|
|
|
|
|
|
|
|
clippy:
|
2020-04-09 19:22:37 -07:00
|
|
|
cargo clippy --all
|
2020-01-04 18:58:42 -08:00
|
|
|
|
2020-03-05 22:51:00 -08:00
|
|
|
fmt:
|
|
|
|
cargo +nightly fmt --all
|
|
|
|
|
2020-01-04 18:58:42 -08:00
|
|
|
lint:
|
2020-01-31 01:54:46 -08:00
|
|
|
./bin/lint
|
2020-01-04 18:58:42 -08:00
|
|
|
|
2020-01-16 20:35:23 -08:00
|
|
|
preview-readme:
|
|
|
|
grip -b README.md
|
|
|
|
|
2020-03-10 16:28:08 -07:00
|
|
|
# build and serve the book
|
|
|
|
book:
|
2020-03-19 19:06:05 -07:00
|
|
|
mdbook serve book --open --dest-dir ../www/book
|
2020-03-10 16:28:08 -07:00
|
|
|
|
2020-01-16 20:35:23 -08:00
|
|
|
dev-deps:
|
|
|
|
brew install grip
|
2020-03-10 16:28:08 -07:00
|
|
|
cargo install mdbook
|
2020-03-21 19:07:05 -07:00
|
|
|
cargo install cargo-watch
|
2020-03-28 03:56:08 -07:00
|
|
|
npm install --global asciicast2gif
|
|
|
|
brew install imagemagick
|
|
|
|
brew install gifsicle
|
2020-01-16 20:35:23 -08:00
|
|
|
|
2020-04-16 04:16:40 -07:00
|
|
|
# update generated documentation
|
|
|
|
gen:
|
|
|
|
cargo run --package gen all
|
2020-03-27 23:13:36 -07:00
|
|
|
|
2020-01-31 01:54:46 -08:00
|
|
|
check-minimal-versions:
|
|
|
|
./bin/check-minimal-versions
|
|
|
|
|
2020-04-16 04:16:40 -07:00
|
|
|
check: test clippy lint check-minimal-versions gen
|
2020-01-31 01:54:46 -08:00
|
|
|
git diff --no-ext-diff --quiet --exit-code
|
2020-03-05 22:51:00 -08:00
|
|
|
cargo +nightly fmt --all -- --check
|
2020-01-16 20:35:23 -08:00
|
|
|
|
2020-04-07 20:17:03 -07:00
|
|
|
draft: push
|
|
|
|
hub pull-request -o --draft
|
|
|
|
|
2020-04-09 19:22:37 -07:00
|
|
|
pr: check push
|
2020-04-05 00:18:03 -07:00
|
|
|
hub pull-request -o
|
|
|
|
|
2020-04-09 16:43:42 -07:00
|
|
|
merge:
|
2020-04-04 02:45:15 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euxo pipefail
|
|
|
|
while ! hub ci-status --verbose; do
|
2020-04-05 00:18:03 -07:00
|
|
|
sleep 5
|
2020-04-04 02:45:15 -07:00
|
|
|
done
|
|
|
|
just done
|
2020-03-17 23:34:46 -07:00
|
|
|
|
2020-04-16 04:16:40 -07:00
|
|
|
publish-check: check
|
2020-02-04 08:06:29 -08:00
|
|
|
cargo outdated --exit-code 1
|
2020-04-20 00:09:14 -07:00
|
|
|
grep '^\[{{version}}\]' CHANGELOG.md
|
2020-01-31 01:54:46 -08:00
|
|
|
|
|
|
|
publish: publish-check
|
2020-04-07 23:50:00 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euxo pipefail
|
|
|
|
while ! hub ci-status --verbose; do
|
|
|
|
sleep 5
|
|
|
|
done
|
2020-01-31 01:54:46 -08:00
|
|
|
git tag -a {{version}} -m 'Release {{version}}'
|
|
|
|
git push github {{version}}
|
2020-03-27 19:28:34 -07:00
|
|
|
cargo publish
|
2020-04-11 04:42:40 -07:00
|
|
|
just merge
|
2020-01-31 01:54:46 -08:00
|
|
|
|
2020-04-07 22:06:44 -07:00
|
|
|
# record, upload, and render demo animation
|
|
|
|
demo: demo-record demo-upload demo-render
|
|
|
|
|
|
|
|
demo-record:
|
2020-03-28 03:56:08 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euxo pipefail
|
|
|
|
cargo build --release --all
|
|
|
|
rm -f tmp/9front.torrent
|
|
|
|
asciinema rec \
|
2020-04-07 22:06:44 -07:00
|
|
|
--title "Intermodal {{version}} Demo" \
|
2020-03-28 03:56:08 -07:00
|
|
|
--command ./target/release/demo \
|
|
|
|
--overwrite \
|
|
|
|
tmp/demo.json
|
2020-04-07 22:06:44 -07:00
|
|
|
|
|
|
|
demo-upload:
|
2020-03-28 03:56:08 -07:00
|
|
|
asciinema upload tmp/demo.json
|
2020-04-07 22:06:44 -07:00
|
|
|
|
|
|
|
demo-render:
|
2020-04-08 02:47:21 -07:00
|
|
|
../asciicast2gif/asciicast2gif -S4 tmp/demo.json www/demo.gif
|
2020-03-28 03:56:08 -07:00
|
|
|
|
2020-03-19 19:06:05 -07:00
|
|
|
# open site index
|
|
|
|
www:
|
|
|
|
open www/index.html
|
2020-01-31 08:20:17 -08:00
|
|
|
|
2019-05-24 01:25:55 -07:00
|
|
|
# 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'
|
2020-01-16 20:35:23 -08:00
|
|
|
|
|
|
|
# download bittorrent.org repository
|
|
|
|
get-beps:
|
|
|
|
git clone git@github.com:bittorrent/bittorrent.org.git tmp/bittorrent.org
|