microsoft/typespec
Publicmirrored from https://github.com/microsoft/typespecAvailable
packages/internal-build-utils/src/cli.ts
33lines · modecode
| 1 | import yargs from "yargs"; |
| 2 | import { generateThirdPartyNotice } from "./generate-third-party-notice.js"; |
| 3 | import { bumpVersionsForPrerelease } from "./prerelease.js"; |
| 4 | |
| 5 | main().catch((e) => { |
| 6 | // eslint-disable-next-line no-console |
| 7 | console.error(e); |
| 8 | process.exit(1); |
| 9 | }); |
| 10 | |
| 11 | async function main() { |
| 12 | await yargs(process.argv.slice(2)) |
| 13 | .scriptName("cadl-build-tool") |
| 14 | .help() |
| 15 | .strict() |
| 16 | .command( |
| 17 | "generate-third-party-notices", |
| 18 | "Generate the third party notice", |
| 19 | () => {}, |
| 20 | () => generateThirdPartyNotice() |
| 21 | ) |
| 22 | .command( |
| 23 | "bump-version-preview <workspaceRoots...>", |
| 24 | "Bump all package version for the preview", |
| 25 | (cmd) => |
| 26 | cmd.positional("workspaceRoots", { |
| 27 | type: "string", |
| 28 | array: true, |
| 29 | demandOption: true, |
| 30 | }), |
| 31 | (args) => bumpVersionsForPrerelease(args.workspaceRoots) |
| 32 | ).argv; |
| 33 | } |
| 34 | |