diff --git a/src/core/cleanup.ts b/src/core/cleanup.ts index 5985ed7..921638b 100644 --- a/src/core/cleanup.ts +++ b/src/core/cleanup.ts @@ -184,7 +184,12 @@ export async function cleanupMultiModel( // Delete from remote (if remote is specified and exists) if (shouldPushToRemote && remoteToDeleteFrom) { for (const tag of localTagNames) { - const result = await deleteRemoteTag(tag, remoteToDeleteFrom, mode, abortSignal); + const result = await deleteRemoteTag( + tag, + remoteToDeleteFrom, + mode, + abortSignal, + ); if (result.ok) { remoteTagNames.push(tag); } else { diff --git a/src/core/close.ts b/src/core/close.ts index c9d834a..0587b6b 100644 --- a/src/core/close.ts +++ b/src/core/close.ts @@ -36,21 +36,27 @@ export async function closeMultiModel( const instructionsArr: string[] = []; const branchesDeleted: string[] = []; const tagsCreated: string[] = []; - const {mode , abortSignal} = options; + const { mode, abortSignal } = options; const safeSessionName = sanitizeName(options.sessionName); try { // Check if session exists - const { ok: sessionExists } = await runCommand([ - "tmux", - "has-session", - "-t", - options.sessionName, - ], { mode, spinnerMsg: `Checking if session '${options.sessionName}' exists...`, abortSignal }); + const { ok: sessionExists } = await runCommand( + ["tmux", "has-session", "-t", options.sessionName], + { + mode, + spinnerMsg: `Checking if session '${options.sessionName}' exists...`, + abortSignal, + }, + ); // Kill tmux session if it exists if (sessionExists) { - await runCommand(["tmux", "kill-session", "-t", options.sessionName], { mode, spinnerMsg: `Killing session '${options.sessionName}'...`, abortSignal }); + await runCommand(["tmux", "kill-session", "-t", options.sessionName], { + mode, + spinnerMsg: `Killing session '${options.sessionName}'...`, + abortSignal, + }); instructionsArr.push( chalk.green(`Closed session '${options.sessionName}'`), ); @@ -135,7 +141,11 @@ export async function closeMultiModel( // Also remove the base directory const worktreeBase = getSessionPath(safeSessionName); try { - await runCommand(["rm", "-rf", worktreeBase], { mode, spinnerMsg: `Removing worktree base directory: ${worktreeBase}...`, abortSignal }); + await runCommand(["rm", "-rf", worktreeBase], { + mode, + spinnerMsg: `Removing worktree base directory: ${worktreeBase}...`, + abortSignal, + }); } catch { // Ignore errors } diff --git a/src/core/open.ts b/src/core/open.ts index 5b67ac4..633797f 100644 --- a/src/core/open.ts +++ b/src/core/open.ts @@ -42,7 +42,7 @@ export async function openMultiModel( const safeSessionName = sanitizeName(sessionName); const models = normalizeModels(options.models); const binaryName = options.binaryName || "opencode"; - const {mode, abortSignal} = options; + const { mode, abortSignal } = options; if (!sessionName) { return { @@ -69,15 +69,14 @@ export async function openMultiModel( }; } - const gitRepoCheck = await runCommand([ - "git", - "rev-parse", - "--is-inside-work-tree", - ], { - mode, - spinnerMsg: "Checking if inside git repository...", - abortSignal, - }); + const gitRepoCheck = await runCommand( + ["git", "rev-parse", "--is-inside-work-tree"], + { + mode, + spinnerMsg: "Checking if inside git repository...", + abortSignal, + }, + ); if (!gitRepoCheck.ok) { return { success: false, @@ -99,7 +98,6 @@ export async function openMultiModel( }; } - const binaryExists = await runCommand(["command", "-v", binaryName], { mode, spinnerMsg: `Checking if ${binaryName} is installed...`, @@ -140,16 +138,14 @@ export async function openMultiModel( }; } - const sessionExists = await runCommand([ - "tmux", - "has-session", - "-t", - sessionName, - ], { - mode, - spinnerMsg: `Checking if tmux session '${sessionName}' already exists...`, - abortSignal, - }); + const sessionExists = await runCommand( + ["tmux", "has-session", "-t", sessionName], + { + mode, + spinnerMsg: `Checking if tmux session '${sessionName}' already exists...`, + abortSignal, + }, + ); if (sessionExists.ok) { return { success: false, @@ -184,17 +180,14 @@ export async function openMultiModel( } } - const branchExists = await runCommand([ - "git", - "show-ref", - "--verify", - "--quiet", - `refs/heads/${branchName}`, - ], { - mode, - spinnerMsg: `Checking if branch '${branchName}' already exists...`, - abortSignal, - }); + const branchExists = await runCommand( + ["git", "show-ref", "--verify", "--quiet", `refs/heads/${branchName}`], + { + mode, + spinnerMsg: `Checking if branch '${branchName}' already exists...`, + abortSignal, + }, + ); if (branchExists.ok) { if (!isFirst) { failedModels.push( @@ -212,7 +205,11 @@ export async function openMultiModel( const worktreeResult = await runCommand( ["git", "worktree", "add", "-b", branchName, worktreePath], - { mode, spinnerMsg: `Creating worktree for ${plan.model}...`, abortSignal }, + { + mode, + spinnerMsg: `Creating worktree for ${plan.model}...`, + abortSignal, + }, ); if (!worktreeResult.ok) { if (!isFirst) { @@ -242,7 +239,11 @@ export async function openMultiModel( "-c", worktreePath, ], - { mode, spinnerMsg: `Starting tmux session '${sessionName}'...`, abortSignal }, + { + mode, + spinnerMsg: `Starting tmux session '${sessionName}'...`, + abortSignal, + }, ); if (!sessionCreateResult.ok) { @@ -266,7 +267,11 @@ export async function openMultiModel( "-c", worktreePath, ], - { mode, spinnerMsg: `Creating tmux window '${plan.windowName}'...`, abortSignal }, + { + mode, + spinnerMsg: `Creating tmux window '${plan.windowName}'...`, + abortSignal, + }, ); if (!windowCreateResult.ok) {