storkit: merge 441_refactor_deduplicate_get_project_root_wrappers_in_io_modules
This commit is contained in:
@@ -3,11 +3,6 @@ use serde::Serialize;
|
||||
use std::path::PathBuf;
|
||||
use std::process::Command;
|
||||
|
||||
/// Helper to get the root path (cloned) without joining
|
||||
fn get_project_root(state: &SessionState) -> Result<PathBuf, String> {
|
||||
state.get_project_root()
|
||||
}
|
||||
|
||||
#[derive(Serialize, Debug, poem_openapi::Object)]
|
||||
pub struct CommandOutput {
|
||||
pub stdout: String,
|
||||
@@ -53,7 +48,7 @@ pub async fn exec_shell(
|
||||
args: Vec<String>,
|
||||
state: &SessionState,
|
||||
) -> Result<CommandOutput, String> {
|
||||
let root = get_project_root(state)?;
|
||||
let root = state.get_project_root()?;
|
||||
exec_shell_impl(command, args, root).await
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user