Skip to main content

ferro_cli/commands/
schedule_run.rs

1//! schedule:run command - Run all due scheduled tasks once
2
3use console::style;
4use std::process::Command;
5
6pub fn run() {
7    println!("{} Running due scheduled tasks...", style("->").cyan());
8    println!();
9
10    // Run cargo run -- schedule:run (unified binary)
11    let status = Command::new("cargo")
12        .args(["run", "--quiet", "--", "schedule:run"])
13        .status()
14        .expect("Failed to execute cargo command");
15
16    if !status.success() {
17        eprintln!();
18        eprintln!("{} Schedule run failed", style("Error:").red().bold());
19        std::process::exit(1);
20    }
21}