Skip to content

Commit

Permalink
fix: misc fixes, removing some useless comments and the Done print st…
Browse files Browse the repository at this point in the history
…atement
  • Loading branch information
ErinvanderVeen committed Mar 14, 2024
1 parent 355a4de commit 2d137a6
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ fn main_with_args(
.build_global()?;
}

// Construct the status update channel
let (status_tx, status_rx): (
std::sync::mpsc::Sender<Message>,
std::sync::mpsc::Receiver<Message>,
Expand All @@ -143,12 +142,8 @@ fn main_with_args(
indicatif::ProgressStyle::with_template("{prefix:.bold.dim} {spinner} {wide_msg}")?
.tick_chars("⠁⠂⠄⡀⢀⠠⠐⠈ ");

// Create the MultiProgress
let multi = indicatif::MultiProgress::new();

let logger = log_builder.build();

// Initialize the logger
let _ = indicatif_log_bridge::LogWrapper::new(multi.clone(), logger).try_init();

Some(std::thread::spawn(move || {
Expand Down Expand Up @@ -187,7 +182,6 @@ fn main_with_args(
None
};

// Call the nixtract function with the provided arguments
let results = nixtract(
opts.flake_ref,
opts.system,
Expand All @@ -198,15 +192,14 @@ fn main_with_args(
Some(status_tx),
)?;

// Print the results
// Print the results to the provided output, and pretty print if specified
for result in results {
let output = if opts.pretty {
serde_json::to_string_pretty(&result)?
} else {
serde_json::to_string(&result)?
};

// Append to the out_writer
out_writer.write_all(output.as_bytes())?;
out_writer.write_all(b"\n")?;
}
Expand All @@ -215,8 +208,6 @@ fn main_with_args(
handle.join().expect("Failed to join the gui thread");
}

println!("Done!");

Ok(())
}

Expand Down

0 comments on commit 2d137a6

Please sign in to comment.