UNPKG

pact-toolbox

Version:

A tool to help you build, test and deploy your Pact smart contracts

28 lines (26 loc) 962 B
import { defineCommand } from "citty"; import { installPact, isAnyPactInstalled, isDockerInstalled, logger } from "@pact-toolbox/utils"; //#region src/commands/doctor.ts const doctorCommand = defineCommand({ meta: { name: "doctor", description: "Check if your system is ready to develop with Pact" }, run: async () => { const isInstalled = await isAnyPactInstalled(); if (!isInstalled) { logger.warn(`Pact is not installed!`); const answer = await logger.prompt(`Would you like to install pact latest version?`, { type: "confirm", default: true }); if (answer === true) await installPact(); } const isDockerOk = isDockerInstalled(); if (!isDockerOk) logger.warn(`We could not establish a connection to docker daemon! make sure it is installed and running on your system.`); logger.box("Your system is ready to develop with Pact!"); } }); //#endregion export { doctorCommand }; //# sourceMappingURL=doctor-BG2jKXxO.js.map