26 lines
934 B
Rust
26 lines
934 B
Rust
//! Phase orchestration: execute a script primitive as a named workflow phase.
|
|||
|
|
//!
|
||
|
|
//! The primary entry-point is `execute_phase`, which delegates to the inner
|
||
|
|
//! script through `execute_primitive` with a forwarded execution context.
|
||
|
|
|
||
|
|
use crate::app::workflow::script::ScriptPrimitive;
|
||
|
|
|
||
|
|
use super::primitives::{execute_primitive, PrimitiveCtx};
|
||
|
|
|
||
|
|
/// Execute a phase by recursing into its inner script primitive with the
|
||
|
|
/// same execution context.
|
||
|
|
pub fn execute_phase(script: &ScriptPrimitive, pc: &PrimitiveCtx) -> anyhow::Result<Vec<String>> {
|
||
|
|
execute_primitive(PrimitiveCtx {
|
||
|
|
primitive: script,
|
||
|
|
args: pc.args,
|
||
|
|
concurrency_cap: pc.concurrency_cap,
|
||
|
|
continue_on_error: pc.continue_on_error,
|
||
|
|
abort_flag: pc.abort_flag,
|
||
|
|
live: pc.live,
|
||
|
|
session_dir: pc.session_dir,
|
||
|
|
workspaces: pc.workspaces,
|
||
|
|
findings: pc.findings,
|
||
|
|
timeout_ms: pc.timeout_ms,
|
||
|
|
})
|
||
|
|
}
|