summaryrefslogtreecommitdiff
path: root/src/dev/check.rs
blob: 1ee717b5be4266492520271c9bfccbc424093af9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::fs;

use anyhow::{Context, Result};

use crate::{info_file::InfoFile, init::cargo_toml};

pub fn check(info_file: InfoFile) -> Result<()> {
    // TODO: Add checks

    fs::write("Cargo.toml", cargo_toml(&info_file.exercises))
        .context("Failed to update the file `Cargo.toml`")?;
    println!("Updated `Cargo.toml`");

    println!("\nEverything looks fine!");

    Ok(())
}