(dir: string)
| 34 | } |
| 35 | |
| 36 | function totalSize(dir: string): number { |
| 37 | let total = 0; |
| 38 | for (const entry of readdirSync(dir, { withFileTypes: true })) { |
| 39 | const path = join(dir, entry.name); |
| 40 | if (entry.isDirectory()) { |
| 41 | total += totalSize(path); |
| 42 | } else { |
| 43 | total += statSync(path).size; |
| 44 | } |
| 45 | } |
| 46 | return total; |
| 47 | } |
| 48 | |
| 49 | export default defineCommand({ |
| 50 | meta: { name: "info", description: "Print project metadata" }, |