mirror of
https://github.com/facebook/docusaurus.git
synced 2025-12-27 20:02:50 +00:00
fix(v2): load plugin commands async to fix broken plugin CLI commands `docs:version` (#3869)
* fix(v2): load plugin commands asynchronously https://github.com/facebook/docusaurus/blame/master/packages/docusaurus/src/commands/external.ts#L12 changed the exported method to an async function, but the CLI loader was not updated to also run async, breaking things such as `npm run docusaurus docs:version <version>`. * chore(v2): resolve lint issue
This commit is contained in:
parent
70dece09e6
commit
415a7973f1
|
|
@ -252,12 +252,16 @@ function isInternalCommand(command) {
|
|||
].includes(command);
|
||||
}
|
||||
|
||||
if (!isInternalCommand(process.argv.slice(2)[0])) {
|
||||
externalCommand(cli, path.resolve('.'));
|
||||
async function run() {
|
||||
if (!isInternalCommand(process.argv.slice(2)[0])) {
|
||||
await externalCommand(cli, path.resolve('.'));
|
||||
}
|
||||
|
||||
cli.parse(process.argv);
|
||||
|
||||
if (!process.argv.slice(2).length) {
|
||||
cli.outputHelp();
|
||||
}
|
||||
}
|
||||
|
||||
cli.parse(process.argv);
|
||||
|
||||
if (!process.argv.slice(2).length) {
|
||||
cli.outputHelp();
|
||||
}
|
||||
run();
|
||||
|
|
|
|||
Loading…
Reference in New Issue