# all
* clippy
* test
* build
* doc
# check
* outdated
* audit
# update
* update-toml
* update-lock
# run
* build
* `target/release/{dirname}`
```
target/release/{dirname}
```
# clippy
* `Cargo.lock`
* `Cargo.toml`
* `src/**/*.rs`
```
cargo clippy -- -D clippy::all
```
# test
* `Cargo.lock`
* `Cargo.toml`
* `src/**/*.rs`
```
cargo test --release
```
# build
* `Cargo.lock`
* `Cargo.toml`
* `src/**/*.rs`
* `README.md`
```
cargo build --release
```
# `README.md`
* `Cargo.toml`
* `CHANGELOG.md`
* `src/**/*.rs`
* `t/README.md`
```
cargo build --release
kapow {0} >{target}
```
# doc
```
cargo doc
```
# outdated
```
cargo outdated --exit-code=1
```
# audit
```
cargo audit
```
# update-toml
```
cargo upgrade -i
```
# update-lock
```
cargo update
```
# install
* `README.md`
```
cargo install --path .
```
# uninstall
```
cargo uninstall $(toml get -r Cargo.toml package.name)
```
# install-deps
```
cargo install cargo-audit cargo-edit cargo-outdated cocomo dtg kapow tokei toml-cli
```
# scaffold
```bash -eo pipefail
if ! toml get -r Cargo.toml package.description >/dev/null; then
toml set Cargo.toml package.description "Insert a description here" >Cargo.toml.new
mv Cargo.toml.new Cargo.toml
echo Edit package description in Cargo.toml, then rerun \`mkrs scaffold\`.
exit 0
fi
mkdir -p t
if [ ! -e t/README.md ]; then
NAME=$(toml get -r Cargo.toml package.name)
ABOUT=$(toml get -r Cargo.toml package.description)
cat <<EOF >t/README.md
# About
$ABOUT
# Usage
~~~~text
\$ $NAME -V
!run:../target/release/$NAME -V 2>&1
~~~~
~~~~text
\$ $NAME -h
!run:../target/release/$NAME -h 2>&1
~~~~
!inc:../CHANGELOG.md
EOF
fi
if [ ! -e CHANGELOG.md ]; then
VERSION=$(toml get -r Cargo.toml package.version)
TODAY=$(dtg -n %Y-%m-%d)
cat <<EOF >CHANGELOG.md
# Changelog
* $VERSION ($TODAY): Initial release
EOF
fi
```
# clean
```
cargo clean
```
# cocomo
```bash -eo pipefail
tokei; echo
cocomo -o sloccount
cocomo
```
# full
* update
* check
* all
* install
# fail
```
echo This command runs
#echo Ignore this command
echo This command runs too but the next one fails
exit 1
echo This does not run because the prior command failed
```
# `nonexistent`
```
echo
```
# custom
```python
print("This is a custom recipe in Python.")
```