Skip to content

Commit

Permalink
Add dev 清理脚本增加正向匹配功能
Browse files Browse the repository at this point in the history
  • Loading branch information
E0SelmY4V committed Feb 22, 2024
1 parent d8dc160 commit cf5e9a8
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
8 changes: 4 additions & 4 deletions packages/dev/actor/clear.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* 清理目录
* @module @mcdjs/dev/tester/all
* @version 1.1.1
* @version 1.2.0
* @license GPL-2.0-or-later
*/
declare module './clear';
Expand All @@ -22,10 +21,11 @@ const {
ignoreList,
} = lb;

export default function def(ignores: string[] = []) {
export default function def(ignores: string[] = [], patterns: (string | RegExp)[] = []) {
lb.ignoreList = [...ignores, ...ignoreList];
const tempReg = RegExp(`${goodReg(dir + path.sep)}.*(\\.d\\.ts|\\.js|\\.js\\.map)$`);
return snake(
dels(RegExp(`${goodReg(dir + path.sep)}.*(\\.d\\.ts|\\.js|\\.js\\.map)$`)),
dels(lb.match([...patterns, tempReg])),
timeEnd(),
log<any>('Clear successfully in', time(), 'ms')
);
Expand Down
2 changes: 1 addition & 1 deletion packages/dev/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "devok",
"version": "1.0.0",
"version": "1.1.0",
"description": "全 TS 开发辅助工具",
"main": "./index",
"module": "./index",
Expand Down
3 changes: 1 addition & 2 deletions packages/dev/tester/all.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* 批量测试
* @module @mcdjs/dev/tester/all
* @version 1.4.0
* @version 1.4.1
* @license GPL-2.0-or-later
*/
declare module './all';
Expand Down
3 changes: 1 addition & 2 deletions packages/dev/tester/import.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* 测试导入
* @module @mcdjs/dev/tester/import
* @version 1.2.1
* @version 1.2.2
* @license GPL-2.0-or-later
*/
declare module './import';
Expand Down
3 changes: 1 addition & 2 deletions packages/dev/tool/checkrun.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* 自动运行
* @module @mcdjs/dev/tool/checkrun
* @version 1.0.0
* @version 1.0.1
* @license GPL-2.0-or-later
*/
declare module './checkrun';
Expand Down

0 comments on commit cf5e9a8

Please sign in to comment.