Skip to content

Commit 0e5b6a6

Browse files
committed
fix progress line overwrite moonc diagnostic
1 parent e0734e6 commit 0e5b6a6

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "n2"
3-
version = "0.1.4"
3+
version = "0.1.5"
44
categories = ["development-tools", "development-tools::build-utils"]
55
edition = "2018"
66
exclude = [".github/*", ".vscode/*"]

src/progress.rs

+5
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,9 @@ impl FancyState {
275275
fn task_finished(&mut self, id: BuildId, build: &Build, result: &TaskResult) {
276276
self.tasks
277277
.remove(self.tasks.iter().position(|t| t.id == id).unwrap());
278+
279+
self.clear_progress();
280+
278281
match result.termination {
279282
Termination::Success => {
280283
// Common case: don't show anything.
@@ -298,6 +301,8 @@ impl FancyState {
298301
std::io::stdout().write_all(&result.output).unwrap();
299302
}
300303
}
304+
305+
// mark as dirty to trigger progress update
301306
self.dirty();
302307
}
303308

tests/e2e/regen.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ fn restat() -> anyhow::Result<()> {
128128
let out = space.run_expect(&mut n2_command(vec!["build.ninja"]))?;
129129
assert_output_not_contains(&out, "touch build.ninja");
130130

131-
// But modifying the input should cause it to be up to date.
131+
std::thread::sleep(std::time::Duration::from_millis(100));
132+
132133
space.write("in", "")?;
133134
let out = space.run_expect(&mut n2_command(vec!["build.ninja"]))?;
134135
assert_output_contains(&out, "touch build.ninja");

0 commit comments

Comments
 (0)