mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
build(sample): replace cli-color with smaller and faster ansis
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import * as childProcess from 'child_process';
|
||||
import * as clc from 'cli-color';
|
||||
import { blue, magenta } from 'ansis';
|
||||
import * as log from 'fancy-log';
|
||||
import { task } from 'gulp';
|
||||
import { resolve } from 'path';
|
||||
@@ -43,7 +43,7 @@ async function executeNPMScriptInDirectory(
|
||||
appendScript?: string,
|
||||
) {
|
||||
const dirName = dir.replace(resolve(__dirname, '../../../'), '');
|
||||
log.info(`Running ${clc.blue(script)} in ${clc.magenta(dirName)}`);
|
||||
log.info(`Running ${blue(script)} in ${magenta(dirName)}`);
|
||||
try {
|
||||
const result = await exec(
|
||||
`${script} --prefix ${dir} ${appendScript ? '-- ' + appendScript : ''}`,
|
||||
@@ -52,7 +52,7 @@ async function executeNPMScriptInDirectory(
|
||||
// cwd: join(process.cwd(), dir),
|
||||
// });
|
||||
|
||||
log.info(`Finished running ${clc.blue(script)} in ${clc.magenta(dirName)}`);
|
||||
log.info(`Finished running ${blue(script)} in ${magenta(dirName)}`);
|
||||
if (result.stderr) {
|
||||
log.error(result.stderr);
|
||||
}
|
||||
@@ -60,7 +60,7 @@ async function executeNPMScriptInDirectory(
|
||||
log.error(result.stdout);
|
||||
}
|
||||
} catch (err) {
|
||||
log.error(`Failed running ${clc.blue(script)} in ${clc.magenta(dirName)}`);
|
||||
log.error(`Failed running ${blue(script)} in ${magenta(dirName)}`);
|
||||
if (err.stderr) {
|
||||
log.error(err.stderr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user