Skip to content

Commit

Permalink
book: improve justfile
Browse files Browse the repository at this point in the history
* List available recipes by default
* Try `cargo binstall` first
* Add recipe comments
* Add `clean` command

Closes #661

Signed-off-by: Yuki Kishimoto <[email protected]>
  • Loading branch information
RandyMcMillan authored and yukibtc committed Dec 7, 2024
1 parent 7e1aabf commit 219556e
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions book/justfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,36 @@
[private]
default:
@just --list

# install book depends
init:
@mdbook --version || cargo install mdbook --version 0.4.40
@mdbook-linkcheck --version || cargo install mdbook-linkcheck --version 0.7.7
@mdbook-admonish --version || cargo install mdbook-admonish --version 1.15.0
@mdbook-snippets --version || cargo install --path ./snippets-processor
@mdbook --version || \
cargo binstall -y --force mdbook --version 0.4.40 || \
cargo install --force mdbook --version 0.4.40
@mdbook-linkcheck --version || \
cargo binstall -y --force mdbook-linkcheck --version 0.7.7 || \
cargo install --force mdbook-linkcheck --version 0.7.7
@mdbook-admonish --version || \
cargo binstall -y --force mdbook-admonish --version 1.15.0 || \
cargo install --force mdbook-admonish --version 1.15.0
@mdbook-snippets --version || \
cargo install --force --path ./snippets-processor

# build book
build: init
mdbook build

# serve book (localhost:3000)
serve: init
mdbook serve

# test snippets
test:
cd snippets && just test

# clean depends
clean:
cargo uninstall mdbook
cargo uninstall mdbook-linkcheck
cargo uninstall mdbook-admonish
cargo uninstall mdbook-snippets

0 comments on commit 219556e

Please sign in to comment.