mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-21 23:33:07 +00:00
fix: Remove unused vars and improve type safety. Improve task recovery
This commit is contained in:
@@ -31,8 +31,8 @@ export async function getTrackedBranches(projectPath: string): Promise<TrackedBr
|
||||
const content = (await secureFs.readFile(filePath, 'utf-8')) as string;
|
||||
const data: BranchTrackingData = JSON.parse(content);
|
||||
return data.branches || [];
|
||||
} catch (error: any) {
|
||||
if (error.code === 'ENOENT') {
|
||||
} catch (error: unknown) {
|
||||
if ((error as NodeJS.ErrnoException).code === 'ENOENT') {
|
||||
return [];
|
||||
}
|
||||
logger.warn('Failed to read tracked branches:', error);
|
||||
|
||||
@@ -117,7 +117,7 @@ export function createCreatePRHandler() {
|
||||
cwd: worktreePath,
|
||||
env: execEnv,
|
||||
});
|
||||
} catch (error: unknown) {
|
||||
} catch {
|
||||
// If push fails, try with --set-upstream
|
||||
try {
|
||||
await execAsync(`git push --set-upstream origin ${branchName}`, {
|
||||
@@ -195,7 +195,7 @@ export function createCreatePRHandler() {
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
} catch {
|
||||
// Couldn't parse remotes - will try fallback
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ export function createCreatePRHandler() {
|
||||
originOwner = owner;
|
||||
repoUrl = `https://github.com/${owner}/${repo}`;
|
||||
}
|
||||
} catch (error) {
|
||||
} catch {
|
||||
// Failed to get repo URL from config
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ export function createDeleteHandler() {
|
||||
// Remove the worktree (using array arguments to prevent injection)
|
||||
try {
|
||||
await execGitCommand(['worktree', 'remove', worktreePath, '--force'], projectPath);
|
||||
} catch (error) {
|
||||
} catch {
|
||||
// Try with prune if remove fails
|
||||
await execGitCommand(['worktree', 'prune'], projectPath);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user