1
0
Fork 0

Fix typos in nih_plug_xtask's readme

This commit is contained in:
Robbert van der Helm 2022-07-03 19:49:20 +02:00
parent 52d9fff313
commit 24d499e716

View file

@ -1,13 +1,13 @@
# NIH-plug: bundler and other utilities # NIH-plug: bundler and other utilities
This is NIH-plug's `cargo xtask` command, but as a library. This way you can use This is NIH-plug's `cargo xtask` command, as a library. This way you can use it
it in your own projects without having to either fork this repo or vendor the in your own projects without having to either fork this repo or vendor the
binary into your own repo. This is necessary until Cargo supports [running binary into your own repo. This is necessary until Cargo supports [running
binaries from dependencies binaries from dependencies
directly](https://github.com/rust-lang/rfcs/pull/3168). directly](https://github.com/rust-lang/rfcs/pull/3168).
To use this, add an `xtask` binary to your project using `cargo new --bin xtask` To use this, add an `xtask` binary to your project using `cargo new --bin xtask`. Then add that binary to the Cargo workspace in your repository's main
and add it to the Cargo workspace in your repository's main `Cargo.toml` file: `Cargo.toml` file like so:
```toml ```toml
# Cargo.toml # Cargo.toml
@ -16,7 +16,8 @@ and add it to the Cargo workspace in your repository's main `Cargo.toml` file:
members = ["xtask"] members = ["xtask"]
``` ```
Then add `nih_plug_xtask` to your new xtask package's dependencies: Add `nih_plug_xtask` to the new xtask package's dependencies, and call its main
function from the new xtask binary:
```toml ```toml
# xtask/Cargo.toml # xtask/Cargo.toml
@ -25,18 +26,16 @@ Then add `nih_plug_xtask` to your new xtask package's dependencies:
nih_plug_xtask = { git = "https://github.com/robbert-vdh/nih-plug.git" } nih_plug_xtask = { git = "https://github.com/robbert-vdh/nih-plug.git" }
``` ```
Call `nih_plug_xtask`'s main function own xtask binary:
```rust ```rust
# xtask/src/main.rs // xtask/src/main.rs
fn main() -> nih_plug_xtask::Result<()> { fn main() -> nih_plug_xtask::Result<()> {
nih_plug_xtask::main() nih_plug_xtask::main()
} }
``` ```
And finally create a `.cargo/config` file in your repository and add a Cargo Lastly, create a `.cargo/config` file in your repository and add a Cargo alias.
alias so you can invoke the binary with `cargo xtask`: This allows you to run the binary using `cargo xtask`:
```toml ```toml
# .cargo/config # .cargo/config