Handle random jetbrains temp files

This commit is contained in:
Vincent Prouillet 2021-02-28 22:30:56 +01:00
parent 2a46e07e74
commit 51644a79e3

View file

@ -477,7 +477,7 @@ pub fn serve(
continue; continue;
} }
if path.is_file() && is_temp_file(&path) { if is_temp_file(&path) {
continue; continue;
} }
@ -485,7 +485,6 @@ pub fn serve(
if path.is_dir() && is_folder_empty(&path) { if path.is_dir() && is_folder_empty(&path) {
continue; continue;
} }
println!( println!(
"Change detected @ {}", "Change detected @ {}",
Local::now().format("%Y-%m-%d %H:%M:%S").to_string() Local::now().format("%Y-%m-%d %H:%M:%S").to_string()
@ -600,7 +599,7 @@ fn is_temp_file(path: &Path) -> bool {
x if x.ends_with("jb_old___") => true, x if x.ends_with("jb_old___") => true,
x if x.ends_with("jb_tmp___") => true, x if x.ends_with("jb_tmp___") => true,
x if x.ends_with("jb_bak___") => true, x if x.ends_with("jb_bak___") => true,
// vim // vim & jetbrains
x if x.ends_with('~') => true, x if x.ends_with('~') => true,
_ => { _ => {
if let Some(filename) = path.file_stem() { if let Some(filename) = path.file_stem() {