Skip to content

Commit

Permalink
chore(justfile): dedup rustdoc command (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkw committed Nov 16, 2022
1 parent 6257e57 commit e4f839b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ _fmt := if env_var_or_default("GITHUB_ACTIONS", "") != "true" { "" } else {
```
}

# arguments to pass to all RustDoc invocations
_rustdoc := _cargo + " doc --no-deps --all-features --document-private-items"

# default recipe to display help information
default:
@echo "justfile for Mycelium"
Expand Down Expand Up @@ -81,14 +84,13 @@ check-docs crate='': (build-docs crate '--cfg docsrs -Dwarnings') (test-docs cra

# open RustDoc documentation for `crate` (or for the whole workspace).
docs crate='' $RUSTDOCFLAGS='--cfg docsrs': (build-docs crate RUSTDOCFLAGS)
{{ _cargo }} doc \
{{ _rustdoc }} \
{{ if crate == '' { '--workspace' } else { '--package' } }} {{ crate }} \
--no-deps --all-features \
--open

# build RustDoc documentation for the workspace.
build-docs crate='' $RUSTDOCFLAGS='--cfg docsrs':
{{ _cargo }} doc --no-deps --all-features --document-private-items \
{{ _rustdoc }} \
{{ if crate == '' { '--workspace' } else { '--package' } }} {{ crate }} \
{{ _fmt }}

Expand Down

0 comments on commit e4f839b

Please sign in to comment.