Cargo uses your git configuration, among other environment variables.
To override it, you should be able to set the CARGO_EMAIL
and CARGO_NAME
environment variables when running cargo. E.g:
CARGO_NAME=not-ross cargo new --bin project_name
For example:
simon /c/rust
$ CARGO_NAME=Not-Simon CARGO_EMAIL=not_simon@not_simon.com cargo new --bin override-author
Created binary (application) `override-author` project
simon /c/rust
$ cd !$
simon /c/rust/override-author (master)
$ cat Cargo.toml
[package]
name = "override-author"
version = "0.1.0"
authors = ["Not-Simon <not_simon@not_simon.com>"]
[dependencies]
Using CARGO_NAME
and CARGO_EMAIL
lets cargo
figure out the author name and email at a higher "scope". Looking at the code in more detail, it will check git first but you can override it with the --vcs
flag which will still use CARGO_NAME
and CARGO_EMAIL
if provided.