fix(install): print version of the browser being downloaded (#146)

This commit is contained in:
Yury Semikhatsky 2019-12-05 09:30:58 -07:00 committed by Dmitry Gozman
parent 4106091870
commit b5af3cac11
4 changed files with 7 additions and 1 deletions

View File

@ -53,7 +53,7 @@ async function downloadBrowser(browser, playwright) {
function onProgress(downloadedBytes, totalBytes) {
if (!progressBar) {
const ProgressBar = require('progress');
progressBar = new ProgressBar(`Downloading ${browser} ${revision} - ${toMegabytes(totalBytes)} [:bar] :percent :etas `, {
progressBar = new ProgressBar(`Downloading ${browser} ${playwright._revision} - ${toMegabytes(totalBytes)} [:bar] :percent :etas `, {
complete: '=',
incomplete: ' ',
width: 20,

View File

@ -25,11 +25,13 @@ import {download, RevisionInfo} from '../download';
export class Playwright {
private _projectRoot: string;
private _launcher: Launcher;
readonly _revision: string;
downloadBrowser: (options?: { onProgress?: (downloadedBytes: number, totalBytes: number) => void; }) => Promise<RevisionInfo>;
constructor(projectRoot: string, preferredRevision: string) {
this._projectRoot = projectRoot;
this._launcher = new Launcher(projectRoot, preferredRevision);
this._revision = preferredRevision;
this.downloadBrowser = download.bind(null, this.createBrowserFetcher(), preferredRevision, 'Chromium');
}

View File

@ -25,11 +25,13 @@ import {download, RevisionInfo} from '../download';
export class Playwright {
private _projectRoot: string;
private _launcher: Launcher;
readonly _revision: string;
downloadBrowser: (options?: { onProgress?: (downloadedBytes: number, totalBytes: number) => void; }) => Promise<RevisionInfo>;
constructor(projectRoot: string, preferredRevision: string) {
this._projectRoot = projectRoot;
this._launcher = new Launcher(projectRoot, preferredRevision);
this._revision = preferredRevision;
this.downloadBrowser = download.bind(null, this.createBrowserFetcher(), preferredRevision, 'Chromium');
}

View File

@ -24,11 +24,13 @@ import { download, RevisionInfo } from '../download';
export class Playwright {
private _projectRoot: string;
private _launcher: Launcher;
readonly _revision: string;
downloadBrowser: (options?: { onProgress?: (downloadedBytes: number, totalBytes: number) => void; }) => Promise<RevisionInfo>;
constructor(projectRoot: string, preferredRevision: string) {
this._projectRoot = projectRoot;
this._launcher = new Launcher(projectRoot, preferredRevision);
this._revision = preferredRevision;
this.downloadBrowser = download.bind(null, this.createBrowserFetcher(), preferredRevision, 'WebKit');
}