mirror of
https://github.com/rust-lang/rustlings.git
synced 2025-01-15 00:00:03 +03:00
feat: stash all changes at once
This commit is contained in:
parent
60d4735d11
commit
ce1a1d1e5a
|
@ -1,6 +1,6 @@
|
||||||
use crate::exercise::{Exercise, ExerciseList};
|
use crate::exercise::{Exercise, ExerciseList};
|
||||||
use crate::project::RustAnalyzerProject;
|
use crate::project::RustAnalyzerProject;
|
||||||
use crate::run::{reset, run, reset_all};
|
use crate::run::{reset, reset_all, run};
|
||||||
use crate::verify::verify;
|
use crate::verify::verify;
|
||||||
use clap::{Parser, Subcommand};
|
use clap::{Parser, Subcommand};
|
||||||
use console::Emoji;
|
use console::Emoji;
|
||||||
|
@ -56,9 +56,7 @@ enum Subcommands {
|
||||||
/// The name of the exercise
|
/// The name of the exercise
|
||||||
name: String,
|
name: String,
|
||||||
},
|
},
|
||||||
ResetAll {
|
ResetAll {},
|
||||||
|
|
||||||
},
|
|
||||||
/// Return a hint for the given exercise
|
/// Return a hint for the given exercise
|
||||||
Hint {
|
Hint {
|
||||||
/// The name of the exercise
|
/// The name of the exercise
|
||||||
|
|
|
@ -36,7 +36,7 @@ pub fn reset_all(exercises: &[Exercise]) -> Result<(), ()> {
|
||||||
for exercise in exercises {
|
for exercise in exercises {
|
||||||
let command = Command::new("git")
|
let command = Command::new("git")
|
||||||
.args(["stash", "push", "--"])
|
.args(["stash", "push", "--"])
|
||||||
.arg (&exercise.path)
|
.arg(&exercise.path)
|
||||||
.spawn();
|
.spawn();
|
||||||
|
|
||||||
if command.is_err() {
|
if command.is_err() {
|
||||||
|
|
Loading…
Reference in a new issue