Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Little exactness tweaks #1874

Merged
merged 2 commits into from
Jun 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(", "));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? It's not an actual regex but the space is there to make it easier to read

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's written like a shell brace-expansion (not a regex) and I copied and pasted it to a shell command (ls, if I remember right) to look at the timestamps on those files, and it didn't work because the spaces end up being wrong extra characters in the filesystem paths.

For someone just looking at it the extra space doesn't matter, but in that case, could leave off the {} so it isn't taken literally.

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