|
1 | 1 | import path from "node:path"; |
2 | 2 | import { performance } from "node:perf_hooks"; |
3 | 3 |
|
| 4 | +import type { CAC } from "cac"; |
| 5 | +import { ACTIVATION, execCommand, loggerInfo, printInfo } from "code-genius"; |
4 | 6 | import enquirer from "enquirer"; |
5 | 7 | import fs from "fs-extra"; |
6 | 8 |
|
7 | | -import { ACTIVATION, execCommand, loggerInfo, printInfo } from "code-genius"; |
8 | | -import { ClearOptions, clearGlob, schema, validateArgs } from "./common"; |
| 9 | +import { clearGlob, ClearOptions, schema, validateArgs } from "./common"; |
9 | 10 |
|
10 | 11 | const generateEnquirer = async ( |
11 | | - paths: Array<string> |
| 12 | + paths: Array<string>, |
12 | 13 | ): Promise<Array<string>> => { |
13 | 14 | const files = fs |
14 | 15 | .readdirSync(path.join(process.cwd(), ".")) |
@@ -53,10 +54,10 @@ const clear = async (paths: string[]) => { |
53 | 54 | }; |
54 | 55 |
|
55 | 56 | const clearInstaller = (config: ClearOptions) => { |
56 | | - const { cli, files } = config; |
| 57 | + const { files } = config; |
57 | 58 | return { |
58 | 59 | name: "clearInstaller", |
59 | | - setup: () => { |
| 60 | + setup: (cli: CAC) => { |
60 | 61 | cli |
61 | 62 | .command("clear", "运行 rimraf 删除不再需要的文件或文件夹") |
62 | 63 | .option("-p, --pattern <pattern>", "设置匹配规则") |
|
0 commit comments