fix(@vant/cli): failed to run lint command

This commit is contained in:
chenjiahan
2021-09-07 15:23:51 +08:00
parent 5a395c27c1
commit 2b7ad935ab
4 changed files with 9 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@vant/cli",
"version": "4.0.0-beta.4",
"version": "4.0.0-beta.5",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"bin": {

View File

@@ -1,5 +1,5 @@
import execa from 'execa';
import { ora } from '../common/logger';
import { consola, ora } from '../common/logger';
import { SCRIPT_EXTS } from '../common/constant';
type RunCommandMessages = {
@@ -17,6 +17,7 @@ function runCommand(
return new Promise((resolve) => {
execa(cmd, options, {
preferLocal: true,
env: { FORCE_COLOR: true },
})
.then(() => {
@@ -25,7 +26,7 @@ function runCommand(
})
.catch((err: any) => {
spinner.fail(messages.failed);
console.log(err.stderr || err.stdout);
consola.error(err.stderr || err.stdout);
resolve(false);
});
});