(err: unknown)
| 825 | } |
| 826 | |
| 827 | function installDetail(err: unknown) { |
| 828 | const hit = installCause(err) ?? err |
| 829 | if (!(hit instanceof Process.RunFailedError)) { |
| 830 | return { |
| 831 | message: errorMessage(hit), |
| 832 | missing: false, |
| 833 | } |
| 834 | } |
| 835 | |
| 836 | const lines = hit.stderr |
| 837 | .toString() |
| 838 | .split(/\r?\n/) |
| 839 | .map((line) => line.trim()) |
| 840 | .filter(Boolean) |
| 841 | const errs = lines.filter((line) => line.startsWith("error:")).map((line) => line.replace(/^error:\s*/, "")) |
| 842 | return { |
| 843 | message: errs[0] ?? lines.at(-1) ?? errorMessage(hit), |
| 844 | missing: lines.some((line) => line.includes("No version matching")), |
| 845 | } |
| 846 | } |
| 847 | |
| 848 | async function addPluginBySpec(state: RuntimeState | undefined, raw: string) { |
| 849 | if (!state) return false |
no test coverage detected