We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 63280ed + 9fc4a83 commit bf8d927Copy full SHA for bf8d927
src/main.rs
@@ -5,6 +5,7 @@ use notify::DebouncedEvent;
5
use notify::{RecommendedWatcher, RecursiveMode, Watcher};
6
use std::ffi::OsStr;
7
use std::io::BufRead;
8
+use std::path::Path;
9
use std::sync::mpsc::channel;
10
use std::time::Duration;
11
use syntect::easy::HighlightFile;
@@ -47,6 +48,14 @@ fn main() {
47
48
println!();
49
}
50
51
+ if !Path::new("info.toml").exists() {
52
+ println!(
53
+ "{} must be run from the rustlings directory",
54
+ std::env::current_exe().unwrap().to_str().unwrap()
55
+ );
56
+ std::process::exit(1);
57
+ }
58
+
59
if let Some(matches) = matches.subcommand_matches("run") {
60
run(matches.clone()).unwrap();
61
0 commit comments