File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed
Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -98,12 +98,9 @@ impl vite_task_plan::PlanRequestParser for PlanRequestParser<'_> {
9898 match self . command_handler . handle_command ( command) . await ? {
9999 HandledCommand :: Synthesized ( synthetic) => Ok ( Some ( PlanRequest :: Synthetic ( synthetic) ) ) ,
100100 HandledCommand :: ViteTaskCommand ( cli_command) => match cli_command {
101- Command :: Cache { .. } => Ok ( Some ( PlanRequest :: Synthetic ( SyntheticPlanRequest {
102- program : Arc :: from ( OsStr :: new ( command. program . as_str ( ) ) ) ,
103- args : Arc :: clone ( & command. args ) ,
104- cache_config : UserCacheConfig :: disabled ( ) ,
105- envs : Arc :: clone ( & command. envs ) ,
106- } ) ) ) ,
101+ Command :: Cache { .. } => Ok ( Some ( PlanRequest :: Synthetic (
102+ command. to_synthetic_plan_request ( UserCacheConfig :: disabled ( ) ) ,
103+ ) ) ) ,
107104 Command :: Run ( run_command) => Ok ( Some ( run_command. into_plan_request ( & command. cwd ) ?) ) ,
108105 } ,
109106 HandledCommand :: Verbatim => Ok ( None ) ,
Original file line number Diff line number Diff line change @@ -18,6 +18,18 @@ pub struct ScriptCommand {
1818 pub cwd : Arc < AbsolutePath > ,
1919}
2020
21+ impl ScriptCommand {
22+ /// Convert this `ScriptCommand` to a `PlanRequest::Synthetic` with the given `cache_config`.
23+ pub fn to_synthetic_plan_request ( & self , cache_config : UserCacheConfig ) -> SyntheticPlanRequest {
24+ SyntheticPlanRequest {
25+ program : Arc :: from ( OsStr :: new ( & self . program ) ) ,
26+ args : self . args . clone ( ) ,
27+ cache_config,
28+ envs : self . envs . clone ( ) ,
29+ }
30+ }
31+ }
32+
2133#[ derive( Debug ) ]
2234pub struct PlanOptions {
2335 pub extra_args : Arc < [ Str ] > ,
You can’t perform that action at this time.
0 commit comments