pact-toolbox
Version:
A tool to help you build, test and deploy your Pact smart contracts
30 lines (28 loc) • 1.04 kB
JavaScript
import { defineCommand } from "citty";
import { resolveConfig } from "@pact-toolbox/config";
import { downloadAllPreludes } from "@pact-toolbox/prelude";
import { PactToolboxClient } from "@pact-toolbox/runtime";
import { logger } from "@pact-toolbox/utils";
import { join } from "pathe";
//#region src/commands/prelude.ts
const preludeCommand = defineCommand({
meta: {
name: "download",
description: "Download configured preludes"
},
run: async () => {
const config = await resolveConfig();
const client = new PactToolboxClient(config);
const start = performance.now();
await downloadAllPreludes({
client,
contractsDir: config.contractsDir ?? "pact",
preludes: config.preludes ?? []
});
const end = performance.now();
logger.box(`All preludes downloaded successfully in ${Math.round(end - start) / 1e3}s 🎉\nYou can load them in repl from ${join(process.cwd(), config.contractsDir ?? "", "prelude", "init.repl")}`);
}
});
//#endregion
export { preludeCommand };
//# sourceMappingURL=prelude-Cv5gJgiU.js.map