From 6c9e93b777238372ceb64dcbc168098f9f35385d Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sat, 28 Feb 2026 19:34:47 +0800 Subject: Add progress bar support --- src/systems/cmd/processer.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/systems/cmd/processer.rs') 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; @@ -10,6 +11,20 @@ pub async fn jv_cmd_process( args: &Vec, ctx: JVCommandContext, renderer_override: String, +) -> Result { + 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, + ctx: JVCommandContext, + renderer_override: String, ) -> Result { info!("{}", t!("verbose.cmd_process_start")); -- cgit