Add missing lockfiles to skip list and show fallback for empty stderr
Several ecosystem lockfiles (Nix flake, Gradle, npm-shrinkwrap, Swift PM) were missing from SKIP_RESOLVE, causing unnecessary conflict resolution attempts. Empty stderr on failure produced confusing error messages.
This commit is contained in:
parent
cbb6bac1b9
commit
374454f0fb
|
|
@ -96,6 +96,10 @@ const SKIP_RESOLVE = new Set([
|
|||
"Podfile.lock",
|
||||
"poetry.lock",
|
||||
"pubspec.lock",
|
||||
"flake.lock",
|
||||
"gradle.lockfile",
|
||||
"npm-shrinkwrap.json",
|
||||
"Package.resolved",
|
||||
"uv.lock",
|
||||
"yarn.lock",
|
||||
])
|
||||
|
|
@ -124,7 +128,8 @@ export async function resolveConflicts(
|
|||
)
|
||||
|
||||
if (resolved.exitCode !== 0) {
|
||||
throw new Error(`Claude failed to resolve ${file}: ${resolved.stderr.toString().trim()}`)
|
||||
const stderr = resolved.stderr.toString().trim()
|
||||
throw new Error(`Claude failed to resolve ${file}: ${stderr || "(no output)"}`)
|
||||
}
|
||||
|
||||
await Bun.write(join(cwd, file), resolved.stdout.trimEnd() + "\n")
|
||||
|
|
|
|||
|
|
@ -137,7 +137,8 @@ export async function commit(message: string, cwd: string): Promise<void> {
|
|||
export async function checkoutTheirs(file: string, cwd: string): Promise<void> {
|
||||
const result = await $`git checkout --theirs -- ${file}`.cwd(cwd).nothrow().quiet()
|
||||
if (result.exitCode !== 0) {
|
||||
throw new Error(`Failed to checkout theirs for ${file}: ${result.stderr.toString().trim()}`)
|
||||
const stderr = result.stderr.toString().trim()
|
||||
throw new Error(`Failed to checkout theirs for ${file}: ${stderr || "(no output)"}`)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -145,7 +146,8 @@ export async function checkoutTheirs(file: string, cwd: string): Promise<void> {
|
|||
export async function stageFile(file: string, cwd: string): Promise<void> {
|
||||
const result = await $`git add ${file}`.cwd(cwd).nothrow().quiet()
|
||||
if (result.exitCode !== 0) {
|
||||
throw new Error(`Failed to stage ${file}: ${result.stderr.toString().trim()}`)
|
||||
const stderr = result.stderr.toString().trim()
|
||||
throw new Error(`Failed to stage ${file}: ${stderr || "(no output)"}`)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user