mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 16:21:11 +00:00
feat(cli): do not run executable if build failed
This commit is contained in:
parent
a0deaa84e6
commit
3fa5b4363e
2 changed files with 10 additions and 4 deletions
|
@ -204,12 +204,15 @@ pub fn build_file<'a>(
|
|||
|
||||
let total_time = compilation_start.elapsed().unwrap();
|
||||
|
||||
// TODO change this to report whether there were errors or warnings!
|
||||
let outcome = match &cmd_result {
|
||||
Ok(exit_status) if exit_status.success() => BuildOutcome::NoProblems,
|
||||
_ => BuildOutcome::Errors,
|
||||
};
|
||||
|
||||
// If the cmd errored out, return the Err.
|
||||
cmd_result?;
|
||||
|
||||
// TODO change this to report whether there were errors or warnings!
|
||||
let outcome = BuildOutcome::NoProblems;
|
||||
|
||||
Ok(BuiltFile {
|
||||
binary_path,
|
||||
outcome,
|
||||
|
|
|
@ -231,7 +231,10 @@ pub fn build(target: &Triple, matches: &ArgMatches, config: BuildConfig) -> io::
|
|||
}
|
||||
}
|
||||
|
||||
roc_run(cmd.current_dir(original_cwd))
|
||||
match outcome {
|
||||
BuildOutcome::Errors => Ok(2),
|
||||
_ => roc_run(cmd.current_dir(original_cwd)),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue