chore(cli): adjust log type

This commit is contained in:
chenjiahan 2023-10-06 10:46:00 +08:00
parent 70938cd120
commit af9b89c42c

View File

@ -9,10 +9,8 @@ import { execSync } from 'child_process';
function logCurrentVersion(cwd: string) { function logCurrentVersion(cwd: string) {
const pkgJson = join(cwd, 'package.json'); const pkgJson = join(cwd, 'package.json');
const pkg = fse.readJSONSync(pkgJson); const pkg = fse.readJSONSync(pkgJson);
logger.success(`${color.bold('Current package:')} ${color.green(pkg.name)}`); logger.info(`${color.bold('Current package:')} ${color.green(pkg.name)}`);
logger.success( logger.info(`${color.bold('Current version:')} ${color.green(pkg.version)}`);
`${color.bold('Current version:')} ${color.green(pkg.version)}`,
);
return { return {
pkgName: pkg.name, pkgName: pkg.name,
currentVersion: pkg.version, currentVersion: pkg.version,
@ -43,7 +41,7 @@ function getNpmTag(version: string, forceTag?: string) {
tag = 'latest'; tag = 'latest';
} }
logger.success(`${color.bold('Npm tag:')} ${color.green(tag)}`); logger.info(`${color.bold('Npm tag:')} ${color.green(tag)}`);
return tag; return tag;
} }
@ -60,7 +58,7 @@ function setPkgVersion(
function buildPackage(pkgJson: Record<string, any>, packageManager: string) { function buildPackage(pkgJson: Record<string, any>, packageManager: string) {
if (pkgJson.scripts?.build) { if (pkgJson.scripts?.build) {
const command = `${packageManager} run build`; const command = `${packageManager} run build`;
logger.success(`${color.bold('Build package:')} ${color.green(command)}`); logger.info(`${color.bold('Build package:')} ${color.green(command)}`);
execSync(command, { stdio: 'inherit' }); execSync(command, { stdio: 'inherit' });
} }
} }