mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-07 05:52:57 +00:00
fix: add colors to cli log output
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
*/
|
||||
import {Api} from '@openstapps/gitlab-api';
|
||||
import {Logger} from '@openstapps/logger';
|
||||
import {AddLogLevel} from '@openstapps/logger/lib/transformations/add-log-level';
|
||||
import {Colorize} from '@openstapps/logger/lib/transformations/colorize';
|
||||
import * as commander from 'commander';
|
||||
import {existsSync, readFileSync} from 'fs';
|
||||
import {join, resolve} from 'path';
|
||||
@@ -32,6 +34,11 @@ process.on('unhandledRejection', async (err) => {
|
||||
|
||||
const gitlabApi = new Api(GITLAB_API_URL, process.env.GITLAB_PRIVATE_TOKEN as string);
|
||||
|
||||
Logger.setTransformations([
|
||||
new AddLogLevel(),
|
||||
new Colorize(),
|
||||
]);
|
||||
|
||||
if (existsSync(join(__dirname, 'package.json'))) {
|
||||
commander.version(JSON.parse(readFileSync(join(__dirname, '..', 'package.json'))
|
||||
.toString()).version);
|
||||
|
||||
Reference in New Issue
Block a user