Appearance
@loontail/minecraft-kit v0.8.14 / runVerifyAndRepair
Function: runVerifyAndRepair()
ts
function runVerifyAndRepair(deps, input): Promise<VerifyAndRepairResult>Verify a single aspect and, in 'fix' mode (default), repair every broken file before returning. In 'report' mode the function never touches disk — it returns the verification only and leaves repair as null.
The helper is a thin orchestrator on top of the existing per-aspect verifiers and repair planners. It exists so consumers do not have to wire three calls (verify → plan → run) by hand for the common "find and fix this aspect" case.
Prefer kit.repair.runVerifyAndRepair({ aspect, target }) over importing this directly.
Parameters
| Parameter | Type |
|---|---|
deps | RunVerifyAndRepairDeps |
input | VerifyAndRepairInput |
Returns
Promise<VerifyAndRepairResult>
Example
ts
import { MinecraftKit, RepairModes } from "@loontail/minecraft-kit";
const kit = new MinecraftKit();
const { verified, repair } = await kit.repair.runVerifyAndRepair({
aspect: "minecraft",
target,
});
if (repair !== null) console.log(`repaired ${repair.actionsCompleted} files`);
const diagnosis = await kit.repair.runVerifyAndRepair({
aspect: "runtime",
target,
mode: RepairModes.REPORT,
});
if (!diagnosis.verified.isValid) console.warn("runtime broken, ask user to repair");