We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 129be9f commit a69069cCopy full SHA for a69069c
src/docs.rs
@@ -66,13 +66,19 @@ pub mod runners {
66
exit(1);
67
}
68
};
69
- let path: String = if cfg!(windows) {
70
- String::from(matches.value_of("INPUT").unwrap())
71
- } else {
72
- matches
73
- .value_of("INPUT")
+ let path: String = if matches.value_of("INPUT").unwrap().contains('~') {
+ home_dir()
+ .expect("Could not find home directory.")
+ .join(
+ Path::new(matches.value_of("INPUT").unwrap())
74
+ .strip_prefix("~")
75
+ .expect("Could not strip shortcut."),
76
+ )
77
+ .to_str()
78
.unwrap()
- .replace("~", home_dir().unwrap().to_str().unwrap())
79
+ .to_string()
80
+ } else {
81
+ String::from(matches.value_of("INPUT").unwrap())
82
83
watcher.watch(&path, RecursiveMode::Recursive).unwrap();
84
println!("Watching for changes in {}...", path);
0 commit comments