diff options
| author | mo8it <mo8it@proton.me> | 2024-04-16 03:30:28 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-04-16 03:30:28 +0200 |
| commit | aa813fbce1305bb1beac88bff47f4279948cb3ac (patch) | |
| tree | a97242ca9b1bb900c882a8fbde075b07b60f6c68 /src/dev | |
| parent | d1ebbaa6f610ec492422806beb34e0dc7e4fc466 (diff) | |
Update Cargo.toml on `dev check`
Diffstat (limited to 'src/dev')
| -rw-r--r-- | src/dev/check.rs | 17 |
1 files changed, 14 insertions, 3 deletions
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(()) } |
