Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add compile time to status message #960

Merged
merged 2 commits into from
Aug 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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