Skip to content

Commit

Permalink
Flush and close trace file normally when using 'moon check --watch --…
Browse files Browse the repository at this point in the history
…trace' (#285)
  • Loading branch information
lgxbslgx authored Sep 11, 2024
1 parent 52013ae commit 04dad14
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions crates/moon/src/cli/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ fn run_check_internal(

let watch_mode = cmd.watch;

if watch_mode {
let res = if watch_mode {
let reg_cfg = RegistryConfig::load();
watching(
&moonc_opt,
Expand All @@ -202,11 +202,13 @@ fn run_check_internal(
}
Ok(if output.is_empty() { 0 } else { 1 })
} else {
let result = entry::run_check(&moonc_opt, &moonbuild_opt, &module);
if cli.trace {
trace::close();
}
result
entry::run_check(&moonc_opt, &moonbuild_opt, &module)
}
};

if cli.trace {
trace::close();
}

res
}

0 comments on commit 04dad14

Please sign in to comment.