From aa813fbce1305bb1beac88bff47f4279948cb3ac Mon Sep 17 00:00:00 2001 From: mo8it Date: Tue, 16 Apr 2024 03:30:28 +0200 Subject: Update Cargo.toml on `dev check` --- src/dev/check.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/dev') diff --git a/src/dev/check.rs b/src/dev/check.rs index 46d3ffe..9ae066b 100644 --- a/src/dev/check.rs +++ b/src/dev/check.rs @@ -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(()) } -- cgit v1.2.3