export async function driveSynthesis()

in packages/utils/blueprint-cli/src/synth-drivers/synth-driver.ts [39:89]


export async function driveSynthesis(log: pino.BaseLogger, options: SynthDriverCliOptions) {
  //validate options
  //TODO

  // we want one driver file that we execute multiple times with different options
  const { synthDriver, resynthDriver } = await makeDriverFile(log, {
    blueprint: options.blueprint,
    cache: options.cache,
  });

  try {
    //figure out which options we have, call synthesis for each of these options
    const wizardConfigurations = getWizardOptions(log, {
      defaultOptionsLocation: options.defaultOptions,
      additionalOptionsLocation: options.additionalOptions,
    });

    for (const wizardOption of wizardConfigurations) {
      const jobname = `${options.jobPrefix || '00.synth.'}${path.parse(wizardOption.path).base}`;
      const outputDir = path.join(options.outdir, `${jobname}`, PROPOSED_BUNDLE_SUBPATH);
      log.info('==========================================');
      log.info(`[${jobname}]`);
      log.info(
        [
          'npx blueprint synth',
          `--options merge[${options.defaultOptions},${wizardOption.path}]`,
          `--blueprint ${options.blueprint}`,
          `--outdir ${outputDir}`,
          `${(options.cache && '--cache') || ''}`,
        ].join(' '),
      );
      log.info('==========================================');
      void (await synthesize(log, {
        blueprintPath: options.blueprint,
        synthDriver,
        blueprintOptions: wizardOption.option,
        jobname,
        outputDirectory: outputDir,
        existingBundle: options.existingBundle || '',
        cleanUp: false,
      }));
    };
  } catch (error) {
    log.error(error as any);
  } finally {
    if (options.cleanUp === true) {
      cleanUpDriver(log, synthDriver);
      cleanUpDriver(log, resynthDriver);
    }
  }
}