sb-mig
Version:
CLI to rule the world. (and handle stuff related to Storyblok CMS)
12 lines (11 loc) • 599 B
JavaScript
import { getFileContentWithRequire } from "../../utils/files.js";
import Logger from "../../utils/logger.js";
import { syncDatasourcesData } from "./datasources.js";
export const syncDatasources = async (args, config) => {
const { providedDatasources, dryRun } = args;
Logger.log(`Trying to sync provided datasources: `);
const providedDatasourcesContent = await Promise.all(providedDatasources.map((datasource) => {
return getFileContentWithRequire({ file: datasource.p });
}));
await syncDatasourcesData({ datasources: providedDatasourcesContent, dryRun }, config);
};