microsoft/typespec
Publicmirrored from https://github.com/microsoft/typespecAvailable
eng/emitters/scripts/upload-bundled-emitter.js
18lines · modecode
| 1 | // @ts-check |
| 2 | import { resolve } from "path"; |
| 3 | import { bundleAndUploadStandalonePackage } from "../../../packages/bundle-uploader/dist/src/index.js"; |
| 4 | import { repoRoot } from "../../common/scripts/helpers.js"; |
| 5 | |
| 6 | const packageRelativePath = process.argv[2]; |
| 7 | if (!packageRelativePath) { |
| 8 | // eslint-disable-next-line no-console |
| 9 | console.error("Usage: node upload-bundled-emitter.js <package-path>"); |
| 10 | // eslint-disable-next-line no-console |
| 11 | console.error(" e.g. node upload-bundled-emitter.js packages/http-client-csharp"); |
| 12 | process.exit(1); |
| 13 | } |
| 14 | |
| 15 | // remove leading slash if exists, then resolve to absolute path |
| 16 | const packagePath = resolve(repoRoot, packageRelativePath.replace(/^\//, "")); |
| 17 | |
| 18 | await bundleAndUploadStandalonePackage({ packagePath }); |