add --registry-name and --license (#233)
This commit is contained in:
parent
44b5ad695d
commit
87e01ff32f
|
@ -155,6 +155,9 @@ For example:
|
||||||
|
|
||||||
This will produce a package in the specified directory.
|
This will produce a package in the specified directory.
|
||||||
|
|
||||||
|
Options `--license` and `--registry-name` may also be used to improve metadata
|
||||||
|
before publishing the static crate.
|
||||||
|
|
||||||
The output will use the published `progenitor-client` crate by default
|
The output will use the published `progenitor-client` crate by default
|
||||||
if progenitor was built from a released version. However, when using progenitor
|
if progenitor was built from a released version. However, when using progenitor
|
||||||
built from the repository, the `progenitor-client` will be inlined into the
|
built from the repository, the `progenitor-client` will be inlined into the
|
||||||
|
|
|
@ -36,6 +36,12 @@ struct Args {
|
||||||
/// Target Rust crate version
|
/// Target Rust crate version
|
||||||
#[clap(short = 'v', long)]
|
#[clap(short = 'v', long)]
|
||||||
version: String,
|
version: String,
|
||||||
|
/// Target Rust crate registry
|
||||||
|
#[clap(long)]
|
||||||
|
registry_name: Option<String>,
|
||||||
|
/// Target crate license
|
||||||
|
#[clap(long, default_value = "SPECIFY A LICENSE BEFORE PUBLISHING")]
|
||||||
|
license_name: String,
|
||||||
|
|
||||||
/// SDK interface style
|
/// SDK interface style
|
||||||
#[clap(value_enum, long, default_value_t = InterfaceArg::Positional)]
|
#[clap(value_enum, long, default_value_t = InterfaceArg::Positional)]
|
||||||
|
@ -132,18 +138,28 @@ fn main() -> Result<()> {
|
||||||
let mut toml = root.clone();
|
let mut toml = root.clone();
|
||||||
toml.push("Cargo.toml");
|
toml.push("Cargo.toml");
|
||||||
|
|
||||||
let tomlout = format!(
|
let mut tomlout = format!(
|
||||||
"[package]\n\
|
"[package]\n\
|
||||||
name = \"{}\"\n\
|
name = \"{}\"\n\
|
||||||
version = \"{}\"\n\
|
version = \"{}\"\n\
|
||||||
edition = \"2021\"\n\
|
edition = \"2021\"\n\"
|
||||||
\n\
|
license = \"{}\"\n",
|
||||||
|
name, version, &args.license_name,
|
||||||
|
);
|
||||||
|
if let Some(registry_name) = args.registry_name {
|
||||||
|
tomlout.extend(
|
||||||
|
format!("publish = [\"{}\"]\n", registry_name).chars(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
tomlout.extend(
|
||||||
|
format!(
|
||||||
|
"\n\
|
||||||
[dependencies]\n\
|
[dependencies]\n\
|
||||||
{}\n\
|
{}\n\
|
||||||
\n",
|
\n",
|
||||||
name,
|
dependencies(builder, args.include_client).join("\n"),
|
||||||
version,
|
)
|
||||||
dependencies(builder, args.include_client).join("\n"),
|
.chars(),
|
||||||
);
|
);
|
||||||
|
|
||||||
save(&toml, tomlout.as_str())?;
|
save(&toml, tomlout.as_str())?;
|
||||||
|
|
Loading…
Reference in New Issue