async function compileBicepParams()

in src/helpers/file.ts [25:49]


async function compileBicepParams(
  paramFilePath: string,
  parameters?: Record<string, unknown>,
) {
  const bicepPath = await installBicep();

  const result = await withBicep(bicepPath, bicep =>
    bicep.compileParams({
      path: paramFilePath,
      parameterOverrides: parameters ?? {},
    }),
  );

  logDiagnostics(result.diagnostics);

  if (!result.success) {
    throw `Failed to compile Bicep parameters file: ${paramFilePath}`;
  }

  return {
    parameters: result.parameters,
    template: result.template,
    templateSpecId: result.templateSpecId,
  };
}