UNPKG

sb-mig

Version:

CLI to rule the world. (and handle stuff related to Storyblok CMS)

16 lines (15 loc) 529 B
import { readFile } from "../../utils/files.js"; import { syncPluginsData } from "./plugins.js"; export const syncProvidedPlugins = async ({ plugins, dryRun }, config) => { const body = dryRun ? "" : await readFile("dist/export.js"); if (!body && !dryRun) { throw new Error("Unable to read plugin bundle from dist/export.js"); } await syncPluginsData({ plugins: plugins.map((name) => ({ name: String(name), body: body ?? "", })), dryRun, }, config); };