Skip to content

Commit 357b60e

Browse files
committed
[Builder] Add original to compression logs
1 parent 4ca7127 commit 357b60e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ for (const platform of [ 'linux', 'osx' ]) { // linux, osx only
5353

5454
const p1 = execFile('unzip', ['-o', zipPath, '-d', extractDir]);
5555
await new Promise((res) => p1.on('close', res));
56-
fs.rmSync(zipPath, { force: true });
5756

5857
const tarPath = zipPath.replace('.zip', '.tar');
5958

@@ -72,9 +71,11 @@ for (const platform of [ 'linux', 'osx' ]) { // linux, osx only
7271
const p3 = execFile('brotli', ['-6', tarPath, '-o', finalPath ]);
7372
await new Promise((res) => p3.on('close', res));
7473

75-
console.log((fs.statSync(tarPath).size / (1024*1024)).toFixed(2), '->', (fs.statSync(finalPath).size / (1024*1024)).toFixed(2));
74+
const getSize = (f) => (fs.statSync(f).size / (1024*1024)).toFixed(2)
75+
console.log('compressed', getSize(tarPath), '->', getSize(finalPath), `(${getSize(zipPath)})`);
7676

7777
fs.rmSync(tarPath, { force: true });
78+
fs.rmSync(zipPath, { force: true });
7879
}
7980
}
8081
}

0 commit comments

Comments
 (0)