Skip to content

Commit

Permalink
Handle dev and local versions better
Browse files Browse the repository at this point in the history
Also improve some error messages
  • Loading branch information
jguhlin committed Nov 24, 2024
1 parent 847ab2c commit cc327fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ libc = "0.2"
needletail = { version = "0.6", optional = true, default-features = false}

# Dep for development
minimap2-sys = { path = "./minimap2-sys" }
minimap2-sys = { path = "./minimap2-sys", version = "0.1.20+minimap2.2.28" }
# minimap2-sys = "0.1.19"
rust-htslib = { version = "0.48", default-features = false, optional = true }

Expand Down
10 changes: 4 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -631,29 +631,27 @@ impl Aligner {
{
let path_str = match std::ffi::CString::new(path.as_ref().as_os_str().as_bytes()) {
Ok(path) => {
// println!("{:#?}", path);
path
}
Err(_) => {
println!("Got error");
return Err("Invalid Path");
return Err("Invalid Path for Index");
}
};

// Confirm file exists
if !path.as_ref().exists() {
return Err("File does not exist");
return Err("Index File does not exist");
}

// Confirm file is not empty
if path.as_ref().metadata().unwrap().len() == 0 {
return Err("File is empty");
return Err("Index File is empty");
}

let output = match output {
Some(output) => match std::ffi::CString::new(output) {
Ok(output) => output,
Err(_) => return Err("Invalid Output"),
Err(_) => return Err("Invalid Output for Index"),
},
None => std::ffi::CString::new(Vec::new()).unwrap(),
};
Expand Down

0 comments on commit cc327fd

Please sign in to comment.