ravel-cli 0.1.0

CLI tool for the Ravel framework: project scaffolding, code generation, migrations, dev server
//! ravel db:seed — run database seeders.
//!
//! Delegates to the user project's `seed` binary via
//! `cargo run --bin seed`.
//!
//! The `seed` binary is generated by `ravel new` at `src/bin/seed.rs`
//! and runs the seeders registered by the user.

use anyhow::Result;
use std::process::Command;

pub fn handle() -> Result<()> {
    let status = Command::new("cargo")
        .arg("run")
        .arg("--bin")
        .arg("seed")
        .status()?;

    if !status.success() {
        anyhow::bail!("Seeding failed with exit code {:?}", status.code());
    }

    Ok(())
}