Skip to content

Commit 0f4a9d4

Browse files
committed
chore($core): cut off process log when resolving unknown commands
1 parent 74d3a5c commit 0f4a9d4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/vuepress/lib/handleUnknownCommand.js

+9
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ module.exports = async function (cli, options) {
3535
sourceDir = pwd
3636
}
3737

38+
/* Prepare Context START */
3839
logger.setOptions({ logLevel: 1 })
3940

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

4647
logger.setOptions({ logLevel: 3 })
48+
/* Prepare Context END */
4749
}
4850
}
4951

@@ -104,12 +106,19 @@ function registerUnknownCommands (cli, options) {
104106
logger.debug('Custom command', chalk.cyan(commandName))
105107
CLI({
106108
async beforeParse (subCli) {
109+
/* Prepare Context START */
110+
logger.setOptions({ logLevel: 1 })
111+
107112
const app = createApp({
108113
sourceDir: sourceDir,
109114
...options,
110115
...commandoptions
111116
})
112117
await app.process()
118+
119+
logger.setOptions({ logLevel: 3 })
120+
/* Prepare Context END */
121+
113122
app.pluginAPI.applySyncOption('extendCli', subCli, app)
114123
console.log()
115124
},

0 commit comments

Comments
 (0)