1 |
|
2 |
|
3 | const Client = require("@minodisk/medkit");
|
4 | const ora = require("ora");
|
5 |
|
6 | module.exports = options => {
|
7 | return new Client(
|
8 | {
|
9 | startLog: title => {
|
10 | const spinner = ora(title).start();
|
11 | return {
|
12 | succeed: text => {
|
13 | spinner.succeed(text ? `${title}: ${text}` : title);
|
14 | },
|
15 | fail: text => {
|
16 | spinner.fail(text ? `${title}: ${text}` : title);
|
17 | },
|
18 | warn: text => {
|
19 | spinner.warn(text ? `${title}: ${text}` : title);
|
20 | },
|
21 | info: text => {
|
22 | spinner.info(text ? `${title}: ${text}` : title);
|
23 | },
|
24 | log: function(text) {
|
25 | spinner.text = text ? `${title}: ${text}` : title;
|
26 | },
|
27 | };
|
28 | },
|
29 | debug: options.debug,
|
30 | },
|
31 | { cookiesPath: options.cookiesPath },
|
32 | );
|
33 | };
|