This commit is contained in:
mo8it
2024-03-28 22:11:16 +01:00
parent 5b4103bbac
commit 3ff9b0cd2a
5 changed files with 74 additions and 54 deletions
+4 -12
View File
@@ -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