Skip to content

Commit 6cbd9ce

Browse files
committed
refactor: rename exec to execute_synthetic and update plan_exec to plan_synthetic
1 parent 593c070 commit 6cbd9ce

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

crates/vite_task/src/session/mod.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -247,27 +247,24 @@ impl<'a> Session<'a> {
247247
///
248248
/// This is for executing a command with cache before/without the entrypoint [`Session::main`].
249249
/// In vite-plus, this is used for auto-install.
250-
pub async fn exec(
250+
pub async fn execute_synthetic(
251251
&self,
252252
synthetic_plan_request: SyntheticPlanRequest,
253253
cache_key: Arc<[Str]>,
254254
silent_if_cache_hit: bool,
255255
) -> anyhow::Result<ExitStatus> {
256-
let plan = self.plan_exec(synthetic_plan_request, cache_key)?;
256+
let plan = ExecutionPlan::plan_synthetic(
257+
&self.workspace_path,
258+
&self.cwd,
259+
synthetic_plan_request,
260+
cache_key,
261+
)?;
257262
let mut reporter = LabeledReporter::new(std::io::stdout(), self.workspace_path());
258263
reporter.set_hide_summary(true);
259264
reporter.set_silent_if_cache_hit(silent_if_cache_hit);
260265
Ok(self.execute(plan, Box::new(reporter)).await.err().unwrap_or(ExitStatus::SUCCESS))
261266
}
262267

263-
fn plan_exec(
264-
&self,
265-
synthetic_plan_request: SyntheticPlanRequest,
266-
cache_key: Arc<[Str]>,
267-
) -> Result<ExecutionPlan, vite_task_plan::Error> {
268-
ExecutionPlan::plan_exec(&self.workspace_path, &self.cwd, synthetic_plan_request, cache_key)
269-
}
270-
271268
pub async fn plan_from_cli(
272269
&mut self,
273270
cwd: Arc<AbsolutePath>,

crates/vite_task_bin/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ async fn run() -> anyhow::Result<ExitStatus> {
4242
envs: Arc::clone(envs),
4343
};
4444
let cache_key: Arc<[Str]> = Arc::from([Str::from("print-env-foo")]);
45-
let status = session.exec(request, cache_key, true).await?;
45+
let status = session.execute_synthetic(request, cache_key, true).await?;
4646
if status != ExitStatus::SUCCESS {
4747
return Ok(status);
4848
}

crates/vite_task_plan/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ impl ExecutionPlan {
226226
Ok(Self { root_node })
227227
}
228228

229-
pub fn plan_exec(
229+
pub fn plan_synthetic(
230230
workspace_path: &Arc<AbsolutePath>,
231231
cwd: &Arc<AbsolutePath>,
232232
synthetic_plan_request: SyntheticPlanRequest,

0 commit comments

Comments
 (0)