mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -05:00
fix(cli): Fixed bug where the progress bar did not clear (#16401)
This commit is contained in:
parent
302590015d
commit
7a65b8e8da
2 changed files with 16 additions and 1 deletions
|
@ -292,6 +292,7 @@ impl ProcState {
|
||||||
dynamic_permissions: Permissions,
|
dynamic_permissions: Permissions,
|
||||||
reload_on_watch: bool,
|
reload_on_watch: bool,
|
||||||
) -> Result<(), AnyError> {
|
) -> Result<(), AnyError> {
|
||||||
|
let _pb_clear_guard = self.progress_bar.clear_guard();
|
||||||
let roots = roots
|
let roots = roots
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|s| (s, ModuleKind::Esm))
|
.map(|s| (s, ModuleKind::Esm))
|
||||||
|
@ -412,7 +413,7 @@ impl ProcState {
|
||||||
self.prepare_node_std_graph().await?;
|
self.prepare_node_std_graph().await?;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.progress_bar.clear();
|
drop(_pb_clear_guard);
|
||||||
|
|
||||||
// type check if necessary
|
// type check if necessary
|
||||||
if self.options.type_check_mode() != TypeCheckMode::None {
|
if self.options.type_check_mode() != TypeCheckMode::None {
|
||||||
|
|
|
@ -126,4 +126,18 @@ impl ProgressBar {
|
||||||
inner.pb = None;
|
inner.pb = None;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn clear_guard(&self) -> ClearGuard {
|
||||||
|
ClearGuard { pb: self.clone() }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ClearGuard {
|
||||||
|
pb: ProgressBar,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Drop for ClearGuard {
|
||||||
|
fn drop(&mut self) {
|
||||||
|
self.pb.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue