Skip to content

Commit

Permalink
Little exactness tweaks (#1874)
Browse files Browse the repository at this point in the history
* 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.)
  • Loading branch information
jonjensen authored Jun 9, 2022
1 parent 294505f commit da799ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/cmd/serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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));
}

Expand Down

0 comments on commit da799ea

Please sign in to comment.