Skip to content

Commit

Permalink
fix: add newline to file
Browse files Browse the repository at this point in the history
  • Loading branch information
Ebedthan committed Mar 24, 2023
1 parent 228e328 commit dc26c4f
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/cmd/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ pub fn search_gtdb(args: utils::SearchArgs) -> Result<()> {
.with_context(|| format!("Failed to create file {path_clone}"))?;
file.write_all(&genome_list.len().to_ne_bytes())
.with_context(|| format!("Failed to write to {path_clone}"))?;
file.write_all("\n".as_bytes())
.with_context(|| format!("Failed to write to {path_clone}"))?;
} else {
writeln!(io::stdout(), "{}", genome_list.len())?;
}
Expand All @@ -170,6 +172,9 @@ pub fn search_gtdb(args: utils::SearchArgs) -> Result<()> {
.with_context(|| {
format!("Failed to write to {path_clone}")
})?;
file.write_all("\n".as_bytes()).with_context(|| {
format!("Failed to write to {path_clone}")
})?;
}
} else {
for gid in list {
Expand Down Expand Up @@ -202,6 +207,9 @@ pub fn search_gtdb(args: utils::SearchArgs) -> Result<()> {
file.write_all(genome_string.as_bytes()).with_context(
|| format!("Failed to write to {path_clone}"),
)?;
file.write_all("\n".as_bytes()).with_context(|| {
format!("Failed to write to {path_clone}")
})?;
}
} else {
let mut stdout_lock = io::stdout().lock();
Expand Down Expand Up @@ -234,6 +242,9 @@ pub fn search_gtdb(args: utils::SearchArgs) -> Result<()> {
file.write_all(genome_string.as_bytes()).with_context(
|| format!("Failed to write to {path_clone}"),
)?;
file.write_all("\n".as_bytes()).with_context(|| {
format!("Failed to write to {path_clone}")
})?;
}
} else {
let mut stdout_lock = io::stdout().lock();
Expand Down Expand Up @@ -270,6 +281,8 @@ pub fn search_gtdb(args: utils::SearchArgs) -> Result<()> {
.with_context(|| format!("Failed to create file {path_clone}"))?;
file.write_all(&genome_list.len().to_ne_bytes())
.with_context(|| format!("Failed to write to {path_clone}"))?;
file.write_all("\n".as_bytes())
.with_context(|| format!("Failed to write to {path_clone}"))?;
} else {
writeln!(io::stdout(), "{}", genome_list.len())?;
}
Expand Down Expand Up @@ -298,6 +311,9 @@ pub fn search_gtdb(args: utils::SearchArgs) -> Result<()> {
.with_context(
|| format!("Failed to write to {path_clone}"),
)?;
file.write_all("\n".as_bytes()).with_context(|| {
format!("Failed to write to {path_clone}")
})?;
}
} else {
let mut stdout_lock = io::stdout().lock();
Expand Down Expand Up @@ -329,6 +345,9 @@ pub fn search_gtdb(args: utils::SearchArgs) -> Result<()> {
.with_context(|| {
format!("Failed to write to {path_clone}")
})?;
file.write_all("\n".as_bytes()).with_context(
|| format!("Failed to write to {path_clone}"),
)?;
}
} else {
let mut stdout_lock = io::stdout();
Expand Down Expand Up @@ -360,6 +379,9 @@ pub fn search_gtdb(args: utils::SearchArgs) -> Result<()> {
.with_context(|| {
format!("Failed to write to {path_clone}")
})?;
file.write_all("\n".as_bytes()).with_context(
|| format!("Failed to write to {path_clone}"),
)?;
}
} else {
let mut stdout_lock = io::stdout();
Expand Down

0 comments on commit dc26c4f

Please sign in to comment.