async function regenerate()

in packages/autorest.python/scripts/eng/regenerate.ts [256:270]


async function regenerate(flags: RegenerateFlagsInput): Promise<void> {
    if (flags.flavor === undefined) {
        await regenerate({ ...flags, flavor: "azure" });
        await regenerate({ ...flags, flavor: "unbranded" });
    } else {
        const flagsResolved = { debug: false, flavor: flags.flavor, ...flags };
        const CADL_RANCH_DIR = resolve(PLUGIN_DIR, "node_modules/@azure-tools/cadl-ranch-specs/http");
        const subdirectories = await getSubdirectories(CADL_RANCH_DIR, flagsResolved);
        const cmdList: TspCommand[] = subdirectories.flatMap((subdirectory) =>
            _getCmdList(subdirectory, flagsResolved),
        );
        const PromiseCommands = cmdList.map((tspCommand) => executeCommand(tspCommand));
        await Promise.all(PromiseCommands);
    }
}