@@ -6,7 +6,7 @@ import { ACTIVATION, execCommand, loggerInfo, printInfo } from "code-genius";
66import enquirer from "enquirer" ;
77import fs from "fs-extra" ;
88
9- import { clearGlob , ClearOptions , schema , validateArgs } from "./common" ;
9+ import { clearGlob , ClearOptions } from "./common" ;
1010
1111const generateEnquirer = async (
1212 paths : Array < string > ,
@@ -44,9 +44,6 @@ const clear = async (paths: string[]) => {
4444 if ( ACTIVATION ) {
4545 loggerInfo ( `clear 参数信息: \n ${ JSON . stringify ( paths ) } ` ) ;
4646 }
47-
48- validateArgs ( schema , paths ) ;
49-
5047 await execCommand ( "npx" , [ "rimraf" , "--glob" , ...paths ] , {
5148 stdio : "inherit" ,
5249 } ) ;
@@ -64,10 +61,10 @@ const clearInstaller = (config: ClearOptions) => {
6461 . option ( "-a, --ask" , "启用询问模式" )
6562 . action ( async ( options ) => {
6663 const { pattern, ask } = options ;
67- let paths = [ ] ;
64+ let paths = files || clearGlob ;
6865 if ( ask ) {
69- paths = await generateEnquirer ( files || clearGlob ) ;
70- } else {
66+ paths = await generateEnquirer ( paths ) ;
67+ } else if ( pattern ) {
7168 paths = typeof pattern === "string" ? [ pattern ] : pattern ;
7269 }
7370 const start = performance . now ( ) ;
0 commit comments