11import { execFile } from "node:child_process" ;
22import type * as VSCode from "vscode" ;
3- import { patchloomNeedsUpgrade , resolvePatchloomStatus } from "../binary/patchloom.js" ;
3+ import { ensurePatchloomReadyOrNotify } from "../binary/patchloom.js" ;
44import { formatCliOutput } from "../util.js" ;
55import { getPatchloomLog } from "../logging/outputChannel.js" ;
66import { activeWorkspaceFolder } from "../workspace/readiness.js" ;
@@ -22,27 +22,12 @@ export function parseBatchOperationCount(plan: string): number {
2222}
2323
2424export async function batchApply ( ) : Promise < void > {
25- const vscode : typeof VSCode = await import ( "vscode" ) ;
26- const status = await resolvePatchloomStatus ( ) ;
27- if ( ! status . ready || ! status . binaryPath ) {
28- const choice = await vscode . window . showWarningMessage ( status . message , "Open Settings" ) ;
29- if ( choice === "Open Settings" ) {
30- await vscode . commands . executeCommand ( "patchloom.openPatchloomSettings" ) ;
31- }
32- return ;
33- }
34-
35- if ( patchloomNeedsUpgrade ( status ) ) {
36- const choice = await vscode . window . showWarningMessage (
37- `${ status . compatibilityMessage } \n\nUpgrade Patchloom before running batch operations.` ,
38- "Open Releases"
39- ) ;
40- if ( choice === "Open Releases" ) {
41- await vscode . commands . executeCommand ( "patchloom.openPatchloomReleases" ) ;
42- }
25+ const binaryPath = await ensurePatchloomReadyOrNotify ( "Upgrade Patchloom before running batch operations." ) ;
26+ if ( ! binaryPath ) {
4327 return ;
4428 }
4529
30+ const vscode : typeof VSCode = await import ( "vscode" ) ;
4631 const folder = await activeWorkspaceFolder ( {
4732 promptIfMany : true ,
4833 placeHolder : "Select workspace folder for batch apply"
@@ -52,7 +37,6 @@ export async function batchApply(): Promise<void> {
5237 return ;
5338 }
5439
55- const binaryPath = status . binaryPath ;
5640 const doc = await vscode . workspace . openTextDocument ( {
5741 language : "plaintext" ,
5842 content : BATCH_TEMPLATE
0 commit comments