Skip to content

Commit 496bb47

Browse files
committed
add ScriptCommand::to_synthetic_plan_request
1 parent 9338d15 commit 496bb47

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

crates/vite_task_plan/src/plan_request.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,19 @@ pub struct ScriptCommand {
1818
pub cwd: Arc<AbsolutePath>,
1919
}
2020

21+
impl ScriptCommand {
22+
/// Convert this `ScriptCommand` to a `SyntheticPlanRequest` with the given `cache_config`.
23+
#[must_use]
24+
pub fn to_synthetic_plan_request(&self, cache_config: UserCacheConfig) -> SyntheticPlanRequest {
25+
SyntheticPlanRequest {
26+
program: Arc::from(OsStr::new(&self.program)),
27+
args: self.args.clone(),
28+
cache_config,
29+
envs: self.envs.clone(),
30+
}
31+
}
32+
}
33+
2134
#[derive(Debug)]
2235
pub struct PlanOptions {
2336
pub extra_args: Arc<[Str]>,

0 commit comments

Comments
 (0)