mirror of
https://github.com/notohh/rustlings.git
synced 2025-08-11 05:33:17 -04:00
Make cargo run
work
This commit is contained in:
parent
8ad18de54c
commit
14f3585816
6 changed files with 214 additions and 4 deletions
src
|
@ -91,9 +91,17 @@ pub struct ContextLine {
|
|||
|
||||
impl Exercise {
|
||||
fn cargo_cmd(&self, command: &str, args: &[&str]) -> Result<Output> {
|
||||
Command::new("cargo")
|
||||
.arg(command)
|
||||
.arg("--color")
|
||||
let mut cmd = Command::new("cargo");
|
||||
cmd.arg(command);
|
||||
|
||||
// A hack to make `cargo run` work when developing Rustlings.
|
||||
// Use `dev/Cargo.toml` when in the directory of the repository.
|
||||
#[cfg(debug_assertions)]
|
||||
if std::path::Path::new("tests").exists() {
|
||||
cmd.arg("--manifest-path").arg("dev/Cargo.toml");
|
||||
}
|
||||
|
||||
cmd.arg("--color")
|
||||
.arg("always")
|
||||
.arg("-q")
|
||||
.arg("--bin")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue