Skip to content

Commit

Permalink
chore: print error if install-deps is used != ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt committed Mar 18, 2022
1 parent f3ffd32 commit cb628e5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/playwright-core/src/utils/dependencies.ts
Expand Up @@ -21,6 +21,7 @@ import childProcess from 'child_process';
import * as utils from './utils';
import { buildPlaywrightCLICommand } from './registry';
import { deps } from './nativeDeps';
import { parseOSReleaseText } from './ubuntuVersion';

const BIN_DIRECTORY = path.join(__dirname, '..', '..', 'bin');

Expand Down Expand Up @@ -53,6 +54,10 @@ export async function installDependenciesWindows(targets: Set<DependencyGroup>,
}

export async function installDependenciesLinux(targets: Set<DependencyGroup>, dryRun: boolean) {
const osReleaseText = await fs.promises.readFile('/etc/os-release', 'utf8');
const fields = parseOSReleaseText(osReleaseText);
if (fields.get('id') !== 'ubuntu')
throw new Error(`Unsupported Linux distribution, only Ubuntu is supported got ${fields.get('id')}!`);
const libraries: string[] = [];
for (const target of targets) {
const info = deps[utils.hostPlatform];
Expand Down

0 comments on commit cb628e5

Please sign in to comment.