diff --git a/src/obikmer/src/cmd/index/mod.rs b/src/obikmer/src/cmd/index/mod.rs index e83f7910..ca9fe857 100644 --- a/src/obikmer/src/cmd/index/mod.rs +++ b/src/obikmer/src/cmd/index/mod.rs @@ -225,7 +225,7 @@ pub fn run(args: IndexArgs) { } info }); - KmerIndex::create(&output, config, genome_info, false).unwrap_or_else(|e| { + KmerIndex::create(&output, config, genome_info, args.force).unwrap_or_else(|e| { eprintln!("error creating index: {e}"); std::process::exit(1); }) diff --git a/src/obikpartitionner/src/partition/kmer_partition.rs b/src/obikpartitionner/src/partition/kmer_partition.rs index e24aad53..891e6f8a 100644 --- a/src/obikpartitionner/src/partition/kmer_partition.rs +++ b/src/obikpartitionner/src/partition/kmer_partition.rs @@ -59,7 +59,11 @@ impl KmerPartition { force: bool, ) -> SKResult { let root_path = path.as_ref().to_owned(); - if root_path.exists() { + // `root_path` itself may already exist as a bare directory: callers + // typically hold an index-level lock file there before creating the + // partition layout. What actually signals a pre-existing partition + // set is the `PARTITIONS_SUBDIR` subdirectory, not the root itself. + if root_path.join(PARTITIONS_SUBDIR).exists() { if force { remove_dir_all(&root_path)?; } else {