Skip to content

Commit

Permalink
feat(main.rs): rename --allow-existing => --force
Browse files Browse the repository at this point in the history
  • Loading branch information
MingcongBai committed Sep 2, 2024
1 parent 8834255 commit 7b84801
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ struct Args {
#[clap(short = 'j', long)]
jobs: Option<usize>,
/// Allow existing target directory
#[clap(long = "allow-existing", default_value = "false")]
allow_existing: bool,
#[clap(long = "force", default_value = "false")]
force: bool,
/// Export a xz compressed tar archive
#[clap(long = "export-tar-xz")]
tar_xz: Option<String>,
Expand Down Expand Up @@ -317,10 +317,10 @@ fn main() {
.unwrap();
let client = network::make_new_client().unwrap();
let target_path = Path::new(target);
let allow_existing = args.allow_existing;
let force = args.force;
let archive_path = target_path.join("var/cache/apt/archives");
let threads = args.jobs.unwrap_or_else(num_cpus::get);
if target_path.exists() && !allow_existing {
if target_path.exists() && !force {
panic!(
"{}",
"Target already exists. Please remove it first."
Expand Down

0 comments on commit 7b84801

Please sign in to comment.