Skip to content

Commit 7db3679

Browse files
committed
feat: load plugins may take several seconds, so display a loading
1 parent 973588e commit 7db3679

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/node/create-cli.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as semver from 'semver';
44

55
import { initGlobalState } from '../utils/global-state';
66
import { TransferedRegisterCommand } from '../utils/define';
7-
import { logFatal } from '../utils/log';
7+
import { logFatal, spinner } from '../utils/log';
88

99
// Check git repo
1010
// let isGitRepo = false;
@@ -46,7 +46,9 @@ export async function createCli(opts?: { pluginIncludeRoots: string[] }) {
4646

4747
await cleanUncessaryFields();
4848

49-
await loadPlugins(opts && opts.pluginIncludeRoots);
49+
await spinner('Load plugins', async () => {
50+
await loadPlugins(opts && opts.pluginIncludeRoots);
51+
});
5052

5153
const commandRegisterMap = transferCommandsArrayToMap(plugin.commands);
5254

0 commit comments

Comments
 (0)