Skip to content

Commit

Permalink
Merge pull request #960 from connor-lennox/add-compile-time
Browse files Browse the repository at this point in the history
add compile time to status message
  • Loading branch information
hannobraun authored Aug 18, 2022
2 parents 457f001 + cf0931f commit 6045e0e
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions crates/fj-host/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use std::{
ops::{Deref, DerefMut},
path::{Path, PathBuf},
process::Command,
str,
sync::mpsc,
thread,
};
Expand Down Expand Up @@ -92,12 +93,22 @@ impl Model {

let command = command_root
.arg("build")
.arg("-q")
.args(["--manifest-path", &manifest_path]);
let exit_status = command.status()?;

let cargo_output = command.output()?;
let exit_status = cargo_output.status;

if exit_status.success() {
status.update_status("Model compiled successfully!");
let seconds_taken = str::from_utf8(&cargo_output.stderr)
.unwrap()
.rsplit_once(' ')
.unwrap()
.1
.trim();
status.update_status(
format!("Model compiled successfully in {seconds_taken}!")
.as_str(),
);
} else {
let output = match command.output() {
Ok(output) => {
Expand Down

0 comments on commit 6045e0e

Please sign in to comment.