diff --git a/utils/generate_dotnet_channels.js b/utils/generate_dotnet_channels.js index 0458ec8b8d..6ad0fd61f7 100755 --- a/utils/generate_dotnet_channels.js +++ b/utils/generate_dotnet_channels.js @@ -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 });