Skip to content
Merged
Changes from 1 commit
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
19 changes: 8 additions & 11 deletions crates/vite_task/src/session/execute/spawn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,14 @@ where
let path_writes = &mut track_result.path_writes;

for access in termination.path_accesses.iter() {
let relative_path = access
.path
.strip_path_prefix(workspace_root, |strip_result| {
let Ok(stripped_path) = strip_result else {
return None;
};
Some(RelativePathBuf::new(stripped_path).map_err(|err| {
anyhow::anyhow!("Invalid relative path '{}': {}", stripped_path.display(), err)
}))
})
.transpose()?;
let relative_path = access.path.strip_path_prefix(workspace_root, |strip_result| {
let Ok(stripped_path) = strip_result else {
return None;
};
// On Windows, path stripping may fail due to case sensitivity or path format
// differences. Treat these as outside workspace rather than failing.
RelativePathBuf::new(stripped_path).ok()
});

let Some(relative_path) = relative_path else {
// Ignore accesses outside the workspace
Expand Down