Skip to content

Commit

Permalink
chore($core): cut off process log when resolving unknown commands
Browse files Browse the repository at this point in the history
  • Loading branch information
ulivz committed Jun 2, 2019
1 parent 74d3a5c commit 0f4a9d4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/vuepress/lib/handleUnknownCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ module.exports = async function (cli, options) {
sourceDir = pwd
}

/* Prepare Context START */
logger.setOptions({ logLevel: 1 })

if (sourceDir) {
Expand All @@ -44,6 +45,7 @@ module.exports = async function (cli, options) {
}

logger.setOptions({ logLevel: 3 })
/* Prepare Context END */
}
}

Expand Down Expand Up @@ -104,12 +106,19 @@ function registerUnknownCommands (cli, options) {
logger.debug('Custom command', chalk.cyan(commandName))
CLI({
async beforeParse (subCli) {
/* Prepare Context START */
logger.setOptions({ logLevel: 1 })

const app = createApp({
sourceDir: sourceDir,
...options,
...commandoptions
})
await app.process()

logger.setOptions({ logLevel: 3 })
/* Prepare Context END */

app.pluginAPI.applySyncOption('extendCli', subCli, app)
console.log()
},
Expand Down

0 comments on commit 0f4a9d4

Please sign in to comment.