Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(devops): fix firefox protocol.ts location #3630

Merged
merged 1 commit into from
Aug 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions utils/protocol-types-generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async function generateProtocol(name, executablePath) {
}

async function generateChromiumProtocol(executablePath) {
const outputPath = path.join(__dirname, '..', '..', 'src', 'server', 'chromium', 'protocol.ts');
const outputPath = path.join(__dirname, '../../src/server/chromium/protocol.ts');
process.env.PLAYWRIGHT_CHROMIUM_DEBUG_PORT = '9339';
const playwright = require('../../index').chromium;
const browser = await playwright.launch({ executablePath });
Expand All @@ -29,8 +29,8 @@ async function generateChromiumProtocol(executablePath) {
}

async function generateWebKitProtocol(folderPath) {
const outputPath = path.join(__dirname, '..', '..', 'src', 'server', 'webkit', 'protocol.ts');
const json = JSON.parse(await fs.promises.readFile(path.join(folderPath, '..', 'protocol.json'), 'utf8'));
const outputPath = path.join(__dirname, '../../src/server/webkit/protocol.ts');
const json = JSON.parse(await fs.promises.readFile(path.join(folderPath, '../protocol.json'), 'utf8'));
await fs.promises.writeFile(outputPath, jsonToTS({domains: json}));
console.log(`Wrote protocol.ts for WebKit to ${path.relative(process.cwd(), outputPath)}`);
}
Expand Down Expand Up @@ -126,10 +126,10 @@ function typeOfProperty(property, domain) {
}

async function generateFirefoxProtocol(executablePath) {
const outputPath = path.join(__dirname, '..', '..', 'src', 'firefox', 'protocol.ts');
const outputPath = path.join(__dirname, '../../src/server/firefox/protocol.ts');
const omnija = os.platform() === 'darwin' ?
path.join(executablePath, '..', '..', 'Resources', 'omni.ja') :
path.join(executablePath, '..', 'omni.ja');
path.join(executablePath, '../../Resources/omni.ja') :
path.join(executablePath, '../omni.ja');
const zip = new StreamZip({file: omnija, storeEntries: true});
// @ts-ignore
await new Promise(x => zip.on('ready', x));
Expand Down