| 160 | } |
| 161 | |
| 162 | async function buildTarball(label, stagingRoot, rootDirName, outFile) { |
| 163 | await tar.create( |
| 164 | { |
| 165 | gzip: { level: 9 }, |
| 166 | file: outFile, |
| 167 | cwd: stagingRoot, |
| 168 | portable: true |
| 169 | }, |
| 170 | [rootDirName] |
| 171 | ); |
| 172 | const size = fs.statSync(outFile).size; |
| 173 | console.log(` ✓ ${label}: ${outFile.replace(ROOT + '/', '')} (${(size / 1024).toFixed(1)} KB)`); |
| 174 | } |
| 175 | |
| 176 | function stageBundle(bundleParent, version, schemasSource, rootDirName, isDev = false) { |
| 177 | if (fs.existsSync(bundleParent)) fs.rmSync(bundleParent, { recursive: true, force: true }); |