Little exactness tweaks (#1874)

* Correct Windows paths

\\ is only for the beginning of UNC paths, e.g.
\\host-name\share-name\file-path
as per
https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file

* Remove spaces path list using brace expansion

In the shell, spaces are significant in a path with brace expansion, and
break it. (As opposed to in Rust module brace expansion.)
This commit is contained in:
Jon Jensen 2022-06-09 13:47:37 -06:00 committed by GitHub
parent 294505f4bc
commit da799ea508
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -419,7 +419,7 @@ pub fn serve(
broadcaster
};
println!("Listening for changes in {}{{{}}}", root_dir.display(), watchers.join(", "));
println!("Listening for changes in {}{{{}}}", root_dir.display(), watchers.join(","));
println!("Press Ctrl+C to stop\n");
// Delete the output folder on ctrl+C
@ -764,9 +764,9 @@ mod tests {
#[cfg(windows)]
fn windows_path_handling() {
let expected = (ChangeKind::Templates, PathBuf::from("/templates/hello.html"));
let pwd = Path::new(r#"C:\\Users\johan\site"#);
let path = Path::new(r#"C:\\Users\johan\site\templates\hello.html"#);
let config_filename = Path::new(r#"C:\\Users\johan\site\config.toml"#);
let pwd = Path::new(r#"C:\Users\johan\site"#);
let path = Path::new(r#"C:\Users\johan\site\templates\hello.html"#);
let config_filename = Path::new(r#"C:\Users\johan\site\config.toml"#);
assert_eq!(expected, detect_change_kind(pwd, path, config_filename));
}