mirror of
https://github.com/bahdotsh/wrkflw.git
synced 2026-05-18 05:05:35 +02:00
Fix CLI vs TUI mode behavior to match README documentation
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user