0.1.2: ability to overwrite versions from arguments
This commit is contained in:
parent
79024d5e42
commit
4e1dfc1b35
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -230,7 +230,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "typst-install"
|
name = "typst-install"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"serde",
|
"serde",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "typst-install"
|
name = "typst-install"
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["Aaron Manning"]
|
authors = ["Aaron Manning"]
|
||||||
|
|
||||||
|
@ -10,6 +10,8 @@ struct Args {
|
|||||||
manifest : path::PathBuf,
|
manifest : path::PathBuf,
|
||||||
#[clap(default_value = "local")]
|
#[clap(default_value = "local")]
|
||||||
namespace : String,
|
namespace : String,
|
||||||
|
#[clap(long, default_value_t = false)]
|
||||||
|
overwrite : bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(serde::Deserialize)]
|
#[derive(serde::Deserialize)]
|
||||||
@ -85,7 +87,7 @@ fn main() {
|
|||||||
.join(manifest.package.name.into_owned())
|
.join(manifest.package.name.into_owned())
|
||||||
.join(manifest.package.version.into_owned());
|
.join(manifest.package.version.into_owned());
|
||||||
|
|
||||||
if package_folder.exists() {
|
if package_folder.exists() && !args.overwrite {
|
||||||
loop {
|
loop {
|
||||||
print!("Package of the corresponding name and version already exists, would you like to continue, overwriting the existing package (y/n)? ");
|
print!("Package of the corresponding name and version already exists, would you like to continue, overwriting the existing package (y/n)? ");
|
||||||
use io::Write;
|
use io::Write;
|
||||||
|
Loading…
Reference in New Issue
Block a user