summaryrefslogtreecommitdiff
path: root/src/systems/cmd
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-02-28 19:34:47 +0800
committer魏曹先生 <1992414357@qq.com>2026-02-28 19:34:47 +0800
commit6c9e93b777238372ceb64dcbc168098f9f35385d (patch)
tree12d4203f95dc7ecd7832028be45d2e3488eabce8 /src/systems/cmd
parent8d791cfd7592d4839fdcb136444b857553f5d4ca (diff)
Add progress bar support
Diffstat (limited to 'src/systems/cmd')
-rw-r--r--src/systems/cmd/processer.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/systems/cmd/processer.rs b/src/systems/cmd/processer.rs
index b4b503e..aa494bb 100644
--- a/src/systems/cmd/processer.rs
+++ b/src/systems/cmd/processer.rs
@@ -1,3 +1,4 @@
+use just_progress::progress;
use log::{error, info, warn};
use rust_i18n::t;
@@ -11,6 +12,20 @@ pub async fn jv_cmd_process(
ctx: JVCommandContext,
renderer_override: String,
) -> Result<JVRenderResult, CmdProcessError> {
+ let result = process(args, ctx, renderer_override).await;
+
+ // Regardless of the result, the progress bar output should be terminated after the command finishes running.
+ // Otherwise, the program will block on the progress bar output.
+ progress::clear_all();
+ progress::close();
+ result
+}
+
+async fn process(
+ args: &Vec<String>,
+ ctx: JVCommandContext,
+ renderer_override: String,
+) -> Result<JVRenderResult, CmdProcessError> {
info!("{}", t!("verbose.cmd_process_start"));
let nodes = jv_cmd_nodes();