Skip to content

Commit

Permalink
fix: canonicalize the path of TemporaryFs
Browse files Browse the repository at this point in the history
  • Loading branch information
siketyan committed Mar 2, 2025
1 parent 4ce59b8 commit 9a95d19
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/biome_fs/src/fs/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,12 @@ impl TemporaryFs {
fs::remove_dir_all(path.as_path()).unwrap();
}
fs::create_dir(&path).unwrap();

// On macOS, the temporary directory is in `/var`, which is a symlink to `/private/var`.
// We need to get the actual path here, or we will get path inconsistency.
#[cfg(target_os = "macos")]
let path = fs::canonicalize(path).unwrap();

Self {
working_directory: Utf8PathBuf::from_path_buf(path).unwrap(),
files: Vec::new(),
Expand Down

0 comments on commit 9a95d19

Please sign in to comment.