mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-22 17:42: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 {Api} from '@openstapps/gitlab-api';
|
||||||
import {Logger} from '@openstapps/logger';
|
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 * as commander from 'commander';
|
||||||
import {existsSync, readFileSync} from 'fs';
|
import {existsSync, readFileSync} from 'fs';
|
||||||
import {join, resolve} from 'path';
|
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);
|
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'))) {
|
if (existsSync(join(__dirname, 'package.json'))) {
|
||||||
commander.version(JSON.parse(readFileSync(join(__dirname, '..', 'package.json'))
|
commander.version(JSON.parse(readFileSync(join(__dirname, '..', 'package.json'))
|
||||||
.toString()).version);
|
.toString()).version);
|
||||||
|
|||||||
Reference in New Issue
Block a user