Skip to content
3 changes: 1 addition & 2 deletions packages/typespec-ts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,7 @@ export async function $onEmit(context: EmitContext) {
);
const hasPackageFile = await existsSync(existingPackageFilePath);
const shouldGenerateMetadata =
option.generateMetadata === true ||
(option.generateMetadata === undefined && !hasPackageFile);
option.generateMetadata === true || !hasPackageFile;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this broke the scenario where a user explicitly passes false to generate-metadata which should be honored. Keyvault is a prime example of this https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/keyvault/keyvault-admin/package.json#L45

const existingTestFolderPath = join(
dpgContext.generationPathDetail?.metadataDir ?? "",
"test"
Expand Down
Loading