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)
|
// Delete from remote (if remote is specified and exists)
|
||||||
if (shouldPushToRemote && remoteToDeleteFrom) {
|
if (shouldPushToRemote && remoteToDeleteFrom) {
|
||||||
for (const tag of localTagNames) {
|
for (const tag of localTagNames) {
|
||||||
const result = await deleteRemoteTag(tag, remoteToDeleteFrom, mode, abortSignal);
|
const result = await deleteRemoteTag(
|
||||||
|
tag,
|
||||||
|
remoteToDeleteFrom,
|
||||||
|
mode,
|
||||||
|
abortSignal,
|
||||||
|
);
|
||||||
if (result.ok) {
|
if (result.ok) {
|
||||||
remoteTagNames.push(tag);
|
remoteTagNames.push(tag);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+19
-9
@@ -36,21 +36,27 @@ export async function closeMultiModel(
|
|||||||
const instructionsArr: string[] = [];
|
const instructionsArr: string[] = [];
|
||||||
const branchesDeleted: string[] = [];
|
const branchesDeleted: string[] = [];
|
||||||
const tagsCreated: string[] = [];
|
const tagsCreated: string[] = [];
|
||||||
const {mode , abortSignal} = options;
|
const { mode, abortSignal } = options;
|
||||||
|
|
||||||
const safeSessionName = sanitizeName(options.sessionName);
|
const safeSessionName = sanitizeName(options.sessionName);
|
||||||
try {
|
try {
|
||||||
// Check if session exists
|
// Check if session exists
|
||||||
const { ok: sessionExists } = await runCommand([
|
const { ok: sessionExists } = await runCommand(
|
||||||
"tmux",
|
["tmux", "has-session", "-t", options.sessionName],
|
||||||
"has-session",
|
{
|
||||||
"-t",
|
mode,
|
||||||
options.sessionName,
|
spinnerMsg: `Checking if session '${options.sessionName}' exists...`,
|
||||||
], { mode, spinnerMsg: `Checking if session '${options.sessionName}' exists...`, abortSignal });
|
abortSignal,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
// Kill tmux session if it exists
|
// Kill tmux session if it exists
|
||||||
if (sessionExists) {
|
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(
|
instructionsArr.push(
|
||||||
chalk.green(`Closed session '${options.sessionName}'`),
|
chalk.green(`Closed session '${options.sessionName}'`),
|
||||||
);
|
);
|
||||||
@@ -135,7 +141,11 @@ export async function closeMultiModel(
|
|||||||
// Also remove the base directory
|
// Also remove the base directory
|
||||||
const worktreeBase = getSessionPath(safeSessionName);
|
const worktreeBase = getSessionPath(safeSessionName);
|
||||||
try {
|
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 {
|
} catch {
|
||||||
// Ignore errors
|
// Ignore errors
|
||||||
}
|
}
|
||||||
|
|||||||
+40
-35
@@ -42,7 +42,7 @@ export async function openMultiModel(
|
|||||||
const safeSessionName = sanitizeName(sessionName);
|
const safeSessionName = sanitizeName(sessionName);
|
||||||
const models = normalizeModels(options.models);
|
const models = normalizeModels(options.models);
|
||||||
const binaryName = options.binaryName || "opencode";
|
const binaryName = options.binaryName || "opencode";
|
||||||
const {mode, abortSignal} = options;
|
const { mode, abortSignal } = options;
|
||||||
|
|
||||||
if (!sessionName) {
|
if (!sessionName) {
|
||||||
return {
|
return {
|
||||||
@@ -69,15 +69,14 @@ export async function openMultiModel(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const gitRepoCheck = await runCommand([
|
const gitRepoCheck = await runCommand(
|
||||||
"git",
|
["git", "rev-parse", "--is-inside-work-tree"],
|
||||||
"rev-parse",
|
{
|
||||||
"--is-inside-work-tree",
|
mode,
|
||||||
], {
|
spinnerMsg: "Checking if inside git repository...",
|
||||||
mode,
|
abortSignal,
|
||||||
spinnerMsg: "Checking if inside git repository...",
|
},
|
||||||
abortSignal,
|
);
|
||||||
});
|
|
||||||
if (!gitRepoCheck.ok) {
|
if (!gitRepoCheck.ok) {
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false,
|
||||||
@@ -99,7 +98,6 @@ export async function openMultiModel(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const binaryExists = await runCommand(["command", "-v", binaryName], {
|
const binaryExists = await runCommand(["command", "-v", binaryName], {
|
||||||
mode,
|
mode,
|
||||||
spinnerMsg: `Checking if ${binaryName} is installed...`,
|
spinnerMsg: `Checking if ${binaryName} is installed...`,
|
||||||
@@ -140,16 +138,14 @@ export async function openMultiModel(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const sessionExists = await runCommand([
|
const sessionExists = await runCommand(
|
||||||
"tmux",
|
["tmux", "has-session", "-t", sessionName],
|
||||||
"has-session",
|
{
|
||||||
"-t",
|
mode,
|
||||||
sessionName,
|
spinnerMsg: `Checking if tmux session '${sessionName}' already exists...`,
|
||||||
], {
|
abortSignal,
|
||||||
mode,
|
},
|
||||||
spinnerMsg: `Checking if tmux session '${sessionName}' already exists...`,
|
);
|
||||||
abortSignal,
|
|
||||||
});
|
|
||||||
if (sessionExists.ok) {
|
if (sessionExists.ok) {
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false,
|
||||||
@@ -184,17 +180,14 @@ export async function openMultiModel(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const branchExists = await runCommand([
|
const branchExists = await runCommand(
|
||||||
"git",
|
["git", "show-ref", "--verify", "--quiet", `refs/heads/${branchName}`],
|
||||||
"show-ref",
|
{
|
||||||
"--verify",
|
mode,
|
||||||
"--quiet",
|
spinnerMsg: `Checking if branch '${branchName}' already exists...`,
|
||||||
`refs/heads/${branchName}`,
|
abortSignal,
|
||||||
], {
|
},
|
||||||
mode,
|
);
|
||||||
spinnerMsg: `Checking if branch '${branchName}' already exists...`,
|
|
||||||
abortSignal,
|
|
||||||
});
|
|
||||||
if (branchExists.ok) {
|
if (branchExists.ok) {
|
||||||
if (!isFirst) {
|
if (!isFirst) {
|
||||||
failedModels.push(
|
failedModels.push(
|
||||||
@@ -212,7 +205,11 @@ export async function openMultiModel(
|
|||||||
|
|
||||||
const worktreeResult = await runCommand(
|
const worktreeResult = await runCommand(
|
||||||
["git", "worktree", "add", "-b", branchName, worktreePath],
|
["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 (!worktreeResult.ok) {
|
||||||
if (!isFirst) {
|
if (!isFirst) {
|
||||||
@@ -242,7 +239,11 @@ export async function openMultiModel(
|
|||||||
"-c",
|
"-c",
|
||||||
worktreePath,
|
worktreePath,
|
||||||
],
|
],
|
||||||
{ mode, spinnerMsg: `Starting tmux session '${sessionName}'...`, abortSignal },
|
{
|
||||||
|
mode,
|
||||||
|
spinnerMsg: `Starting tmux session '${sessionName}'...`,
|
||||||
|
abortSignal,
|
||||||
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!sessionCreateResult.ok) {
|
if (!sessionCreateResult.ok) {
|
||||||
@@ -266,7 +267,11 @@ export async function openMultiModel(
|
|||||||
"-c",
|
"-c",
|
||||||
worktreePath,
|
worktreePath,
|
||||||
],
|
],
|
||||||
{ mode, spinnerMsg: `Creating tmux window '${plan.windowName}'...`, abortSignal },
|
{
|
||||||
|
mode,
|
||||||
|
spinnerMsg: `Creating tmux window '${plan.windowName}'...`,
|
||||||
|
abortSignal,
|
||||||
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!windowCreateResult.ok) {
|
if (!windowCreateResult.ok) {
|
||||||
|
|||||||
Reference in New Issue
Block a user