diff options
| author | mo8it <mo8it@proton.me> | 2024-03-28 22:11:16 +0100 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-03-28 22:11:16 +0100 |
| commit | 3ff9b0cd2a92a531e8c7a9f8a0f86b9fac04d252 (patch) | |
| tree | 0676bbd4b9eca6224e56e45f0f3740722d41e116 /src/run.rs | |
| parent | 5b4103bbac180fcb1de747214647811a3622b476 (diff) | |
POC done
Diffstat (limited to 'src/run.rs')
| -rw-r--r-- | src/run.rs | 16 |
1 files changed, 4 insertions, 12 deletions
@@ -1,6 +1,7 @@ -use std::process::Command; +use std::io; use std::time::Duration; +use crate::embedded::{WriteStrategy, EMBEDDED_FILES}; use crate::exercise::{Exercise, Mode}; use crate::verify::test; use indicatif::ProgressBar; @@ -19,17 +20,8 @@ pub fn run(exercise: &Exercise, verbose: bool) -> Result<(), ()> { } // Resets the exercise by stashing the changes. -pub fn reset(exercise: &Exercise) -> Result<(), ()> { - let command = Command::new("git") - .arg("stash") - .arg("--") - .arg(&exercise.path) - .spawn(); - - match command { - Ok(_) => Ok(()), - Err(_) => Err(()), - } +pub fn reset(exercise: &Exercise) -> io::Result<()> { + EMBEDDED_FILES.write_exercise_to_disk(&exercise.path, WriteStrategy::Overwrite) } // Invoke the rust compiler on the path of the given exercise |
