summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs9
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.";