Fix CLI vs TUI mode behavior to match README documentation

This commit is contained in:
bahdotsh
2025-04-21 11:37:52 +05:30
parent 478be38cfc
commit 0d43d44242
2 changed files with 8 additions and 4 deletions

View File

@@ -114,8 +114,8 @@ async fn main() {
executor::RuntimeType::Docker
};
// Run in TUI mode with the specific workflow
match ui::run_wrkflw_tui(Some(path), runtime_type, verbose).await {
// Run in CLI mode with the specific workflow
match ui::execute_workflow_cli(path, runtime_type, verbose).await {
Ok(_) => {
// Clean up on successful exit
cleanup_on_exit().await;

View File

@@ -2224,12 +2224,16 @@ pub async fn run_wrkflw_tui(
// If the TUI fails to initialize or crashes, fall back to CLI mode
eprintln!("Failed to start UI: {}", e);
// Only for 'tui' command should we fall back to CLI mode for files
// For other commands, return the error
if let Some(path) = path {
if path.is_file() {
println!("Falling back to CLI mode...");
eprintln!("Falling back to CLI mode...");
execute_workflow_cli(path, runtime_type, verbose).await
} else {
} else if path.is_dir() {
validate_workflow(path, verbose)
} else {
Err(e)
}
} else {
Err(e)