这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
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: 8 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/turborepo-fs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ edition = "2021"

[dependencies]
anyhow = { workspace = true }
fs-err = "2.9.0"
turbopath = { workspace = true }
walkdir = "2.3.3"

Expand Down
5 changes: 3 additions & 2 deletions crates/turborepo-fs/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#![deny(clippy::all)]

use std::fs::{self, DirBuilder, Metadata};
use std::fs::{DirBuilder, FileType, Metadata};

use anyhow::Result;
use fs_err as fs;
use turbopath::{AbsoluteSystemPath, AnchoredSystemPathBuf};
use walkdir::WalkDir;

Expand Down Expand Up @@ -91,7 +92,7 @@ pub fn copy_file(

fn copy_file_with_type(
from: impl AsRef<AbsoluteSystemPath>,
from_type: fs::FileType,
from_type: FileType,
to: impl AsRef<AbsoluteSystemPath>,
) -> Result<()> {
let from = from.as_ref();
Expand Down
1 change: 1 addition & 0 deletions crates/turborepo-paths/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ edition = "2021"
[dependencies]
camino = { workspace = true }
dunce = { workspace = true }
fs-err = "2.9.0"
path-clean = "1.0.1"
# TODO: Make this a crate feature
serde = { workspace = true }
Expand Down
3 changes: 2 additions & 1 deletion crates/turborepo-paths/src/absolute_system_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ use std::os::unix::fs::symlink as symlink_dir;
#[cfg(windows)]
use std::os::windows::fs::{symlink_dir, symlink_file};
use std::{
fmt, fs,
fmt,
fs::{File, Metadata, OpenOptions},
io,
path::Path,
};

use camino::{Utf8Component, Utf8Components, Utf8Path, Utf8PathBuf};
use fs_err as fs;
use path_clean::PathClean;

use crate::{
Expand Down
6 changes: 4 additions & 2 deletions crates/turborepo-paths/src/absolute_system_path_buf.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
use std::{
borrow::Borrow,
fmt, fs,
fmt,
io::{self, Write},
ops::Deref,
path::{Path, PathBuf},
};

use camino::{Utf8Components, Utf8Path, Utf8PathBuf};
use fs_err as fs;
use path_clean::PathClean;
use serde::Serialize;

Expand Down Expand Up @@ -233,7 +234,8 @@ impl AbsoluteSystemPathBuf {
}

pub fn try_exists(&self) -> Result<bool, PathError> {
Ok(fs::try_exists(&self.0)?)
// try_exists is an experimental API and not yet in fs_err
Ok(std::fs::try_exists(&self.0)?)
}

pub fn extension(&self) -> Option<&str> {
Expand Down