//! A dummy adapter for Radicle CI.

use tempfile::tempdir;

use radicle_ci_adapter::*;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let request = read_request()?; // Read request.
    eprintln!("{request:#?}\n");

    let run_id = RunId::default();
    let info_url = "https://liw.fi";
    write_triggered(&run_id, Some(info_url))?;

    let mut adminlog = AdminLog::default();

    let tmp = tempdir()?;
    get_sources(
        &mut adminlog,
        false,
        request.repo(),
        request.commit()?,
        tmp.path(),
    )?;
    eprintln!("got sources!");

    write_succeeded()?;

    Ok(())
}
