(bytes)
| 21 | const SKIP_DIR_GLOBS = ['node_modules', 'src'] |
| 22 | |
| 23 | function bytesToSize(bytes) { |
| 24 | const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'] |
| 25 | if (bytes === 0) { |
| 26 | return '0 Byte' |
| 27 | } |
| 28 | const i = Number.parseInt(Math.floor(Math.log(bytes) / Math.log(1024))) |
| 29 | return `${Math.round(bytes / 1024 ** i, 2)} ${sizes[i]}` |
| 30 | } |
| 31 | |
| 32 | (async () => { |
| 33 | await writeZip('devtools-chrome.zip', 'shell-chrome') |