mirror of
https://github.com/bendtherules/opencode-multi-model.git
synced 2026-08-18 13:42:21 +00:00
fix: lint fix
This commit is contained in:
+6
-1
@@ -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 {
|
||||
|
||||
+18
-8
@@ -41,16 +41,22 @@ export async function closeMultiModel(
|
||||
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
|
||||
}
|
||||
|
||||
+30
-25
@@ -69,15 +69,14 @@ export async function openMultiModel(
|
||||
};
|
||||
}
|
||||
|
||||
const gitRepoCheck = await runCommand([
|
||||
"git",
|
||||
"rev-parse",
|
||||
"--is-inside-work-tree",
|
||||
], {
|
||||
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,
|
||||
], {
|
||||
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}`,
|
||||
], {
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user