chore: fix utils/generate_dotnet_channels.js after monorepo (#10710)

This commit is contained in:
Max Schmitt 2021-12-03 18:51:25 -08:00 committed by GitHub
parent b7ba039436
commit ea9475d37d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -126,7 +126,7 @@ function objectType(props, indent, onlyOptional = false) {
return { ts: `${indent}{${inner.ts}\n${indent}}`, scheme: `tObject({\n${inner.scheme}\n${indent}})` };
}
const yml = fs.readFileSync(path.join(__dirname, '..', 'src', 'protocol', 'protocol.yml'), 'utf-8');
const yml = fs.readFileSync(path.join(__dirname, '..', 'packages', 'playwright-core', 'src', 'protocol', 'protocol.yml'), 'utf-8');
const protocol = yaml.parse(yml);
for (const [name, value] of Object.entries(protocol)) {
@ -139,6 +139,11 @@ for (const [name, value] of Object.entries(protocol)) {
mixins.set(name, value);
}
if (!process.argv[2]) {
console.error('.NET repository needs to be specified as an argument.\n'+ `Usage: node ${path.relative(process.cwd(), __filename)} ../playwright-dotnet/src/Playwright/`);
process.exit(1);
}
const dir = path.join(process.argv[2], 'Transport', 'Protocol', 'Generated')
fs.mkdirSync(dir, { recursive: true });