summaryrefslogtreecommitdiff
path: root/src/run.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/run.rs')
-rw-r--r--src/run.rs16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/run.rs b/src/run.rs
index 6dd0388..792bd8f 100644
--- a/src/run.rs
+++ b/src/run.rs
@@ -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