cleanout 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -3
- package/src/commands/cleanout.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cleanout",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "clean out the clutter, ship the code; one command your project is clean.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -31,6 +31,8 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/jaswanreddych/cleanout#readme",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"
|
|
34
|
+
"cleanout": "^1.0.1",
|
|
35
|
+
"express": "^5.2.1",
|
|
36
|
+
"g": "^2.0.1"
|
|
35
37
|
}
|
|
36
|
-
}
|
|
38
|
+
}
|
package/src/commands/cleanout.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import fsp from "fs/promises"
|
|
2
2
|
import { c } from "../constants/color.js"
|
|
3
3
|
import { getSize, scan } from "../utils/scanner.js"
|
|
4
4
|
import { confirm, printDone, printDryRun, printEmptyMatches, printMatches, printStats, startSpinner } from "../utils/ui.js"
|
|
@@ -67,7 +67,7 @@ export async function cleanout(targetDir, config) {
|
|
|
67
67
|
let space = 0
|
|
68
68
|
for (const item of matches) {
|
|
69
69
|
try {
|
|
70
|
-
|
|
70
|
+
await fsp.rm(item.path, { recursive: true, force: true })
|
|
71
71
|
space += item.size
|
|
72
72
|
} catch (error) {
|
|
73
73
|
console.log(`${c.red}✖ failed to delete ${item.path}: ${error.message}${c.reset}`)
|