diff options
| author | mo8it <mo8it@proton.me> | 2024-04-21 19:34:55 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-04-21 19:34:55 +0200 |
| commit | 49e4a1fab04560cf0e868ab8214dfc94e76b9f4b (patch) | |
| tree | 7e91b9c86cf79913de4790fad112d07e9f13cae4 /src/main.rs | |
| parent | 04d36996dd745af284be380bd902e0bad491b87a (diff) | |
Catch the usage of the old method
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 69ac0a3..bf2498a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -75,6 +75,10 @@ enum Subcommands { fn main() -> Result<()> { let args = Args::parse(); + if !DEBUG_PROFILE && Path::new("dev/rustlings-repo.txt").exists() { + bail!("{OLD_METHOD_ERR}"); + } + which::which("cargo").context(CARGO_NOT_FOUND_ERR)?; match args.command { @@ -174,6 +178,11 @@ fn main() -> Result<()> { Ok(()) } +const OLD_METHOD_ERR: &str = "You are trying to run Rustlings using the old method before v6. +The new method doesn't include cloning the Rustlings' repository. +Please follow the instructions in the README: +https://github.com/rust-lang/rustlings#getting-started"; + const CARGO_NOT_FOUND_ERR: &str = "Failed to find `cargo`. Did you already install Rust? Try running `cargo --version` to diagnose the problem."; |
