Skip to content

Commit 4e79dfe

Browse files
committed
Switch to using a cleanup script that can find more stuff.
This gets rid of all those anoying .DS_Store files too.
1 parent 049e532 commit 4e79dfe

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
"scripts": {
3131
"all": "run-s clean lint build test",
32-
"clean": "rm -rf ./dist",
32+
"clean": "bun ./scripts/clean.ts",
3333
"build": "bun ./scripts/build.ts",
3434
"test": "bun test --dots --coverage ./test/*.js",
3535
"lint": "eslint ./src/diff3.mjs ./test/*.js"

scripts/clean.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { $, Glob } from 'bun';
2+
3+
// Remove these files if found anywhere
4+
const files = [
5+
'.DS_Store',
6+
'npm-debug.log',
7+
'package-lock.json',
8+
'pnpm-lock.yaml',
9+
'yarn.lock'
10+
];
11+
12+
for (const f of files) {
13+
const glob = new Glob(`**/${f}`);
14+
for await (const file of glob.scan({ dot: true })) {
15+
await $`rm -f ${file}`;
16+
}
17+
}
18+
19+
// Remove these specific folders
20+
const folders = [
21+
'./coverage',
22+
'./dist'
23+
];
24+
for (const f of folders) {
25+
await $`rm -rf ${f}`;
26+
}

0 commit comments

Comments
 (0)