From b5af3cac1129f4cbcd56c9953ec0cf3dd01ac1cb Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Thu, 5 Dec 2019 09:30:58 -0700 Subject: [PATCH] fix(install): print version of the browser being downloaded (#146) --- install.js | 2 +- src/chromium/Playwright.ts | 2 ++ src/firefox/Playwright.ts | 2 ++ src/webkit/Playwright.ts | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/install.js b/install.js index 0a7bc7f34c..9da4545241 100644 --- a/install.js +++ b/install.js @@ -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, diff --git a/src/chromium/Playwright.ts b/src/chromium/Playwright.ts index eab8e44860..076af17086 100644 --- a/src/chromium/Playwright.ts +++ b/src/chromium/Playwright.ts @@ -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; 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'); } diff --git a/src/firefox/Playwright.ts b/src/firefox/Playwright.ts index 6634398c71..dcf0061312 100644 --- a/src/firefox/Playwright.ts +++ b/src/firefox/Playwright.ts @@ -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; 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'); } diff --git a/src/webkit/Playwright.ts b/src/webkit/Playwright.ts index a3a84bff38..83faf63d2d 100644 --- a/src/webkit/Playwright.ts +++ b/src/webkit/Playwright.ts @@ -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; 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'); }