Skip to content

Commit d44ccf8

Browse files
committed
Fix build size
1 parent 739098e commit d44ccf8

1 file changed

Lines changed: 7 additions & 22 deletions

File tree

ci/buildRelease.js

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,6 @@ const getFileChecksum = async (filePath) => new Promise((resolve) => {
5252
checksum.file(filePath, { algorithm: 'sha256' } , (_, hash) => resolve(hash));
5353
});
5454

55-
const unpackFile = async (filePath, destinationPath) => tar.extract({
56-
cwd: destinationPath,
57-
file: filePath
58-
});
59-
60-
const packBundle = async (context, sourcePaths, destinationFile) => tar.create(
61-
{
62-
cwd: context,
63-
file: destinationFile,
64-
gzip: true
65-
},
66-
sourcePaths
67-
);
68-
69-
7055
const bundleGit = ({
7156
buildDirectory,
7257
expectedChecksum,
@@ -107,20 +92,20 @@ const bundleGit = ({
10792

10893
mkdirp.sync(vendorDirectoryPath);
10994

110-
fs.copyFile(gitRsBinaryPath, path.join(buildDirectory, gitRsBinaryName), (error) => {
111-
if (error) {
112-
console.log(`Could not copy git-rs binaries`);
113-
process.exit(1);
114-
}
115-
});
95+
fs.copyFileSync(gitRsBinaryPath, path.join(buildDirectory, gitRsBinaryName));
11696

11797
try {
118-
await unpackFile(tempFile, vendorDirectoryPath);
98+
await tar.extract({
99+
cwd: vendorDirectoryPath,
100+
file: tempFile
101+
});
119102
} catch (error) {
120103
console.log('Could not extract git archive');
121104
process.exit(1);
122105
}
123106

107+
fs.unlinkSync(path.join(tempFile));
108+
124109
try {
125110
zip.zipSync(buildDirectory, `${process.env.TARGET}.zip`);
126111
} catch (error) {

0 commit comments

Comments
 (0)