From 4e1dfc1b352e36d53f1c6567930ee0c720767d98 Mon Sep 17 00:00:00 2001 From: Aaron Manning Date: Fri, 29 Mar 2024 15:33:04 +1100 Subject: [PATCH] 0.1.2: ability to overwrite versions from arguments --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/main.rs | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5c8c905..77f391c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -230,7 +230,7 @@ dependencies = [ [[package]] name = "typst-install" -version = "0.1.0" +version = "0.1.1" dependencies = [ "clap", "serde", diff --git a/Cargo.toml b/Cargo.toml index eb7d67d..4646b23 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "typst-install" -version = "0.1.1" +version = "0.1.2" edition = "2021" authors = ["Aaron Manning"] diff --git a/src/main.rs b/src/main.rs index 3cb3842..34a31b1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,6 +10,8 @@ struct Args { manifest : path::PathBuf, #[clap(default_value = "local")] namespace : String, + #[clap(long, default_value_t = false)] + overwrite : bool, } #[derive(serde::Deserialize)] @@ -85,7 +87,7 @@ fn main() { .join(manifest.package.name.into_owned()) .join(manifest.package.version.into_owned()); - if package_folder.exists() { + if package_folder.exists() && !args.overwrite { loop { print!("Package of the corresponding name and version already exists, would you like to continue, overwriting the existing package (y/n)? "); use io::Write;