fix(native): name the plist selection that works when Info.plist is missing
inspect_plist on a target without a readable default Contents/Info.plist (for example a bare Mach-O) reported the generic "This analysis is unavailable for the current target. Choose another analysis or target." as message and remediation. The specific reason, including "Pass path to inspect another plist", appeared only in details.reason, although selecting another plist in the same target is the available workflow. Pass that reason as the refusal's user message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
aa5750c263
commit
a6fdf426bd
|
|
@ -819,11 +819,14 @@ const unreadablePlist = (
|
|||
reason: string,
|
||||
): AnalysisError => {
|
||||
const sentence = reason.endsWith(".") ? reason : `${reason}.`;
|
||||
// Name the default that is missing and the selection that still works.
|
||||
const missingDefault = `The target has no readable Contents/Info.plist at ${path}: ${sentence} Pass path to inspect another plist.`;
|
||||
return requested === undefined
|
||||
? new AnalysisCapabilityUnavailableError(
|
||||
IDENTITY.id,
|
||||
"inspect_plist",
|
||||
`The target has no readable Contents/Info.plist at ${path}: ${sentence} Pass path to inspect another plist.`,
|
||||
missingDefault,
|
||||
{ userMessage: missingDefault },
|
||||
)
|
||||
: new AnalysisInputError("inspect_plist", undefined, [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -113,6 +113,14 @@ describe.skipIf(process.platform !== "darwin")(
|
|||
expect(result.exitCode).toBe(1);
|
||||
expect(result.json).toMatchObject({
|
||||
code: "capability_unavailable",
|
||||
message: expect.stringContaining(
|
||||
"Pass path to inspect another plist",
|
||||
),
|
||||
remediation: {
|
||||
action: expect.stringContaining(
|
||||
"Pass path to inspect another plist",
|
||||
),
|
||||
},
|
||||
details: {
|
||||
operation: "inspect_plist",
|
||||
reason: expect.stringContaining(
|
||||
|
|
|
|||
Loading…
Reference in New Issue