kibana/x-pack/tasks/download_chromium.ts
Tyler Smalley f0b4986099
Restores task for downloading Chromium builds (#71749)
This was removed in https://github.com/elastic/kibana/pull/69165 without
realizing it was used by the packer cache. I renamed it to be more
inline with what it actually does.

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-07-15 06:53:40 -07:00

27 lines
969 B
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { LevelLogger } from '../plugins/reporting/server/lib';
import { ensureBrowserDownloaded } from '../plugins/reporting/server/browsers/download';
export const downloadChromium = async () => {
// eslint-disable-next-line no-console
const consoleLogger = (tag: string) => (message: unknown) => console.log(tag, message);
const innerLogger = {
get: () => innerLogger,
debug: consoleLogger('debug'),
info: consoleLogger('info'),
warn: consoleLogger('warn'),
trace: consoleLogger('trace'),
error: consoleLogger('error'),
fatal: consoleLogger('fatal'),
log: consoleLogger('log'),
};
const levelLogger = new LevelLogger(innerLogger);
await ensureBrowserDownloaded(levelLogger);
};