Update Cargo.toml on dev check

This commit is contained in:
mo8it
2024-04-16 03:30:28 +02:00
parent d1ebbaa6f6
commit aa813fbce1
4 changed files with 20 additions and 7 deletions
+14 -3
View File
@@ -1,5 +1,16 @@
use anyhow::Result;
use std::fs;
pub fn check() -> Result<()> {
todo!()
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!("Everything looks fine!");
Ok(())
}