fix(core): canonicalize watch event paths on all linux distros (#19848)

Co-authored-by: Jason Jean <jasonjean1993@gmail.com>
This commit is contained in:
Jonathan Cammisuli 2023-10-25 18:51:31 -04:00 committed by GitHub
parent 900c1c9b37
commit a7e0abd3e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 16 deletions

10
Cargo.lock generated
View File

@ -1353,7 +1353,6 @@ dependencies = [
"napi-build",
"napi-derive",
"once_cell",
"os_type",
"parking_lot",
"rayon",
"regex",
@ -1380,15 +1379,6 @@ version = "1.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
[[package]]
name = "os_type"
version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e24d44c0eea30167516ed8f6daca4b5e3eebcde1bde1e4e6e08b809fb02c7ba5"
dependencies = [
"regex",
]
[[package]]
name = "overload"
version = "0.1.1"

View File

@ -14,7 +14,6 @@ ignore = '0.4'
ignore-files = "1.3.0"
itertools = "0.10.5"
once_cell = "1.18.0"
os_type = "2.6.0"
parking_lot = { version = "0.12.1", features = ["send_guard"] }
napi = { version = '2.12.6', default-features = false, features = [
'anyhow',

View File

@ -1,7 +1,5 @@
use ignore::WalkBuilder;
use ignore_files::IgnoreFile;
use once_cell::sync::Lazy;
use os_type::{OSInformation, OSType};
use std::{fs, path::PathBuf};
use tracing::trace;
use watchexec_events::{Event, Tag};
@ -56,10 +54,8 @@ pub(super) fn get_ignore_files<T: AsRef<str>>(root: T) -> Vec<IgnoreFile> {
// .collect()
// }
static OS_PLATFORM: Lazy<OSInformation> = Lazy::new(os_type::current_platform);
pub(super) fn transform_event(watch_event: &Event) -> Option<Event> {
if OS_PLATFORM.os_type == OSType::Debian || OS_PLATFORM.os_type == OSType::Arch {
if cfg!(linux) {
let tags = watch_event
.tags
.clone()