huskies: merge 950
This commit is contained in:
@@ -16,6 +16,7 @@ pub(super) async fn read_file(path: String, state: &SessionState) -> Result<Stri
|
||||
.map_err(Error::Filesystem)
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub(super) async fn write_file(
|
||||
path: String,
|
||||
content: String,
|
||||
@@ -26,6 +27,7 @@ pub(super) async fn write_file(
|
||||
.map_err(Error::Filesystem)
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub(super) async fn list_directory(
|
||||
path: String,
|
||||
state: &SessionState,
|
||||
@@ -41,6 +43,7 @@ pub(super) async fn list_directory_absolute(path: String) -> Result<Vec<FileEntr
|
||||
.map_err(Error::Filesystem)
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub(super) async fn create_directory_absolute(path: String) -> Result<(), Error> {
|
||||
crate::io::fs::create_directory_absolute(path)
|
||||
.await
|
||||
@@ -58,6 +61,7 @@ pub(super) async fn list_project_files(state: &SessionState) -> Result<Vec<Strin
|
||||
.map_err(Error::Filesystem)
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub(super) async fn search_files(
|
||||
query: String,
|
||||
state: &SessionState,
|
||||
@@ -67,6 +71,7 @@ pub(super) async fn search_files(
|
||||
.map_err(Error::Filesystem)
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub(super) async fn exec_shell(
|
||||
command: String,
|
||||
args: Vec<String>,
|
||||
|
||||
@@ -65,12 +65,14 @@ pub async fn read_file(path: String, state: &SessionState) -> Result<String, Err
|
||||
}
|
||||
|
||||
/// Write a file to the project root, creating parent directories as needed.
|
||||
#[allow(dead_code)]
|
||||
pub async fn write_file(path: String, content: String, state: &SessionState) -> Result<(), Error> {
|
||||
validate_path(&path)?;
|
||||
io::write_file(path, content, state).await
|
||||
}
|
||||
|
||||
/// List directory entries at a project-relative path.
|
||||
#[allow(dead_code)]
|
||||
pub async fn list_directory(path: String, state: &SessionState) -> Result<Vec<FileEntry>, Error> {
|
||||
io::list_directory(path, state).await
|
||||
}
|
||||
@@ -81,6 +83,7 @@ pub async fn list_directory_absolute(path: String) -> Result<Vec<FileEntry>, Err
|
||||
}
|
||||
|
||||
/// Create a directory (and all parents) at an absolute path.
|
||||
#[allow(dead_code)]
|
||||
pub async fn create_directory_absolute(path: String) -> Result<(), Error> {
|
||||
io::create_directory_absolute(path).await
|
||||
}
|
||||
@@ -96,11 +99,13 @@ pub async fn list_project_files(state: &SessionState) -> Result<Vec<String>, Err
|
||||
}
|
||||
|
||||
/// Search the project for files whose contents contain `query`.
|
||||
#[allow(dead_code)]
|
||||
pub async fn search_files(query: String, state: &SessionState) -> Result<Vec<SearchResult>, Error> {
|
||||
io::search_files(query, state).await
|
||||
}
|
||||
|
||||
/// Execute an allowlisted shell command in the project root directory.
|
||||
#[allow(dead_code)]
|
||||
pub async fn exec_shell(
|
||||
command: String,
|
||||
args: Vec<String>,
|
||||
|
||||
Reference in New Issue
Block a user