]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - scripts/client-build-stats.ts
Don't process live when moving to external storage
[github/Chocobozzz/PeerTube.git] / scripts / client-build-stats.ts
CommitLineData
99bb59fa
C
1import { readdir, stat } from 'fs-extra'
2import { join } from 'path'
06aad801 3import { root } from '@shared/core-utils'
99bb59fa
C
4
5async function run () {
6 const result = {
7 app: await buildResult(join(root(), 'client', 'dist', 'en-US')),
8 embed: await buildResult(join(root(), 'client', 'dist', 'standalone', 'videos'))
9 }
10
11 console.log(JSON.stringify(result))
12}
13
14run()
15 .catch(err => console.error(err))
16
17async function buildResult (path: string) {
18 const distFiles = await readdir(path)
19
d93e4316 20 const files: { name: string, size: number }[] = []
99bb59fa
C
21
22 for (const file of distFiles) {
23 const filePath = join(path, file)
24
25 const statsResult = await stat(filePath)
d93e4316
C
26 files.push({
27 name: file,
28 size: statsResult.size
29 })
99bb59fa
C
30 }
31
32 return files
33}