mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-15 14:11:50 +03:00
chore: rename env variables (#11661)
These variables aren't CLI-only anymore, so pick some more general names for them. Note: all language ports would need to follow-up with the rename after the next roll. Fixes #11450
This commit is contained in:
parent
d6e6d33db3
commit
0606afb2e6
@ -38,7 +38,7 @@ const packageJSON = require('../../package.json');
|
|||||||
|
|
||||||
program
|
program
|
||||||
.version('Version ' + (process.env.PW_CLI_DISPLAY_VERSION || packageJSON.version))
|
.version('Version ' + (process.env.PW_CLI_DISPLAY_VERSION || packageJSON.version))
|
||||||
.name(buildBasePlaywrightCLICommand(process.env.PW_CLI_TARGET_LANG));
|
.name(buildBasePlaywrightCLICommand(process.env.PW_LANG_NAME));
|
||||||
|
|
||||||
commandWithOpenOptions('open [url]', 'open page in browser specified via -b, --browser', [])
|
commandWithOpenOptions('open [url]', 'open page in browser specified via -b, --browser', [])
|
||||||
.action(function(url, options) {
|
.action(function(url, options) {
|
||||||
@ -235,7 +235,7 @@ Examples:
|
|||||||
|
|
||||||
$ show-trace https://example.com/trace.zip`);
|
$ show-trace https://example.com/trace.zip`);
|
||||||
|
|
||||||
if (!process.env.PW_CLI_TARGET_LANG) {
|
if (!process.env.PW_LANG_NAME) {
|
||||||
let playwrightTestPackagePath = null;
|
let playwrightTestPackagePath = null;
|
||||||
try {
|
try {
|
||||||
playwrightTestPackagePath = require.resolve('@playwright/test/lib/cli', {
|
playwrightTestPackagePath = require.resolve('@playwright/test/lib/cli', {
|
||||||
@ -559,7 +559,7 @@ function logErrorAndExit(e: Error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function language(): string {
|
function language(): string {
|
||||||
return process.env.PW_CLI_TARGET_LANG || 'test';
|
return process.env.PW_LANG_NAME || 'test';
|
||||||
}
|
}
|
||||||
|
|
||||||
function commandWithOpenOptions(command: string, description: string, options: any[][]): Command {
|
function commandWithOpenOptions(command: string, description: string, options: any[][]): Command {
|
||||||
|
@ -477,12 +477,12 @@ function determineUserAgent(): string {
|
|||||||
|
|
||||||
let langName = 'unknown';
|
let langName = 'unknown';
|
||||||
let langVersion = 'unknown';
|
let langVersion = 'unknown';
|
||||||
if (!process.env.PW_CLI_TARGET_LANG) {
|
if (!process.env.PW_LANG_NAME) {
|
||||||
langName = 'node';
|
langName = 'node';
|
||||||
langVersion = process.version.substring(1).split('.').slice(0, 2).join('.');
|
langVersion = process.version.substring(1).split('.').slice(0, 2).join('.');
|
||||||
} else if (['node', 'python', 'java', 'csharp'].includes(process.env.PW_CLI_TARGET_LANG)) {
|
} else if (['node', 'python', 'java', 'csharp'].includes(process.env.PW_LANG_NAME)) {
|
||||||
langName = process.env.PW_CLI_TARGET_LANG;
|
langName = process.env.PW_LANG_NAME;
|
||||||
langVersion = process.env.PW_CLI_TARGET_LANG_VERSION ?? 'unknown';
|
langVersion = process.env.PW_LANG_NAME_VERSION ?? 'unknown';
|
||||||
}
|
}
|
||||||
|
|
||||||
return `Playwright/${getPlaywrightVersion()} (${os.arch()}; ${osIdentifier} ${osVersion}) ${langName}/${langVersion}`;
|
return `Playwright/${getPlaywrightVersion()} (${os.arch()}; ${osIdentifier} ${osVersion}) ${langName}/${langVersion}`;
|
||||||
|
Loading…
Reference in New Issue
Block a user