How to use the contentful-migration/built/bin/lib/render-migration.renderValidationErrors function in contentful-migration

To help you get started, we’ve selected a few contentful-migration examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github deluan / contentful-migrate / lib / run.js View on Github external
process.exit(1)
  }
  if (parseResult.hasStepsValidationErrors()) {
    stepsError.default(parseResult.stepsValidationErrors)
    process.exit(1)
  }
  if (parseResult.hasPayloadValidationErrors()) {
    stepsError.default(parseResult.payloadValidationErrors)
    process.exit(1)
  }
  // const migrationName = path.basename(argv.filePath, '.js');
  // const errorsFile = path.join(process.cwd(), `errors-${migrationName}-${Date.now()}.log`);
  const errorsFile = path.join(process.cwd(), `errors-${Date.now()}.log`)
  const { batches } = parseResult
  if (parseResult.hasValidationErrors()) {
    renderMigration.renderValidationErrors(batches)
    process.exit(1)
  }
  if (parseResult.hasRuntimeErrors()) {
    renderMigration.renderRuntimeErrors(batches, errorsFile)
    await writeErrorsToLog.default(parseResult.getRuntimeErrors(), errorsFile)
    process.exit(1)
  }
  await renderMigration.renderPlan(batches)
  const serverErrorsWritten = []
  const tasks = batches.map((batch) => {
    return {
      title: batch.intent.toPlanMessage().heading,
      task: () => new Listr([
        {
          title: 'Making requests',
          task: async (_ctx, task) => {