Merge pull request #1258 from morluto/fix/inspect-plist-default-remediation
fix(native): name the plist selection that works when Info.plist is missing
This commit is contained in:
@@ -819,11 +819,14 @@ const unreadablePlist = (
|
|||||||
reason: string,
|
reason: string,
|
||||||
): AnalysisError => {
|
): AnalysisError => {
|
||||||
const sentence = reason.endsWith(".") ? reason : `${reason}.`;
|
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} Select another plist in the target with the path input (CLI: --relative-path).`;
|
||||||
return requested === undefined
|
return requested === undefined
|
||||||
? new AnalysisCapabilityUnavailableError(
|
? new AnalysisCapabilityUnavailableError(
|
||||||
IDENTITY.id,
|
IDENTITY.id,
|
||||||
"inspect_plist",
|
"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, [
|
: new AnalysisInputError("inspect_plist", undefined, [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -113,6 +113,12 @@ describe.skipIf(process.platform !== "darwin")(
|
|||||||
expect(result.exitCode).toBe(1);
|
expect(result.exitCode).toBe(1);
|
||||||
expect(result.json).toMatchObject({
|
expect(result.json).toMatchObject({
|
||||||
code: "capability_unavailable",
|
code: "capability_unavailable",
|
||||||
|
message: expect.stringContaining("(CLI: --relative-path)"),
|
||||||
|
remediation: {
|
||||||
|
action: expect.stringContaining(
|
||||||
|
"Select another plist in the target with the path input (CLI: --relative-path).",
|
||||||
|
),
|
||||||
|
},
|
||||||
details: {
|
details: {
|
||||||
operation: "inspect_plist",
|
operation: "inspect_plist",
|
||||||
reason: expect.stringContaining(
|
reason: expect.stringContaining(
|
||||||
|
|||||||
Reference in New Issue
Block a user