]>
Commit | Line | Data |
---|---|---|
99bb59fa C |
1 | import { registerTSPaths } from '../server/helpers/register-ts-paths' |
2 | registerTSPaths() | |
3 | ||
4 | import { readdir, stat } from 'fs-extra' | |
5 | import { join } from 'path' | |
6 | import { root } from '@server/helpers/core-utils' | |
7 | ||
8 | async function run () { | |
9 | const result = { | |
10 | app: await buildResult(join(root(), 'client', 'dist', 'en-US')), | |
11 | embed: await buildResult(join(root(), 'client', 'dist', 'standalone', 'videos')) | |
12 | } | |
13 | ||
14 | console.log(JSON.stringify(result)) | |
15 | } | |
16 | ||
17 | run() | |
18 | .catch(err => console.error(err)) | |
19 | ||
20 | async function buildResult (path: string) { | |
21 | const distFiles = await readdir(path) | |
22 | ||
d93e4316 | 23 | const files: { name: string, size: number }[] = [] |
99bb59fa C |
24 | |
25 | for (const file of distFiles) { | |
26 | const filePath = join(path, file) | |
27 | ||
28 | const statsResult = await stat(filePath) | |
d93e4316 C |
29 | files.push({ |
30 | name: file, | |
31 | size: statsResult.size | |
32 | }) | |
99bb59fa C |
33 | } |
34 | ||
35 | return files | |
36 | } |