export function loadManifest()

in utils/manifest-utils.ts [13:30]


export function loadManifest(file: string | undefined) {
  const data = (() => {
    if (file == undefined) {
      throw new Error("Invalid Manifest File");
    }
    if (path.extname(file) == '.yaml') {
        return fs.readFileSync(file, 'utf8');
    } else {
      throw new Error("Invalid Manifest Path");
    }
  })();
  const manifest = yaml.loadAll(data);
  if (manifest.length > 0) {
      const id = path.basename(file, ".yaml")
      return { id, manifest };
  }
  throw new Error("Invalid Manifest File");
}