Skip to content

Commit 7bab929

Browse files
committed
Zip the correct executable
1 parent ff4fecb commit 7bab929

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

packages/build/src/compile-exec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const executablePath = (outputDir: string, platform: string): string => {
6868
* @param {string} outputDir - The output directory for the executable.
6969
* @param {string} platform - The platform.
7070
*/
71-
const compileExec = async(input: string, outputDir: string, platform: string) => {
71+
const compileExec = async(input: string, outputDir: string, platform: string): Promise<string> => {
7272
const executable = executablePath(outputDir, platform);
7373
console.log('mongosh: creating binary:', executable);
7474
await compile([
@@ -78,6 +78,7 @@ const compileExec = async(input: string, outputDir: string, platform: string) =>
7878
'-t',
7979
determineTarget(platform)
8080
]);
81+
return executable;
8182
};
8283

8384
export default compileExec;

packages/build/src/release.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ const release = async(config: Config) => {
2424
});
2525

2626
// - Build the executable.
27-
await compileExec(config.input, config.outputDir, platform);
27+
const executable = await compileExec(config.input, config.outputDir, platform);
2828

2929
// - Sign the executable
3030

3131
// - Zip the executable.
32-
const artifact = await zip(config.input, config.outputDir, platform, config.version);
32+
const artifact = await zip(executable, config.outputDir, platform, config.version);
3333

3434
if (platform === Platform.MacOs) {
3535
// - Notarize the zip.

packages/build/src/zip.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ const zipPosix = async(outputDir: string, filename: string) => {
4545
* @param {string} input - The file to zip.
4646
* @param {string} filename - the zip filename.
4747
*/
48-
const zipWindows = async(input: string, filename: string) => {
48+
const zipWindows = (input: string, filename: string) => {
4949
const admZip = new AdmZip();
5050
admZip.addLocalFile(input)
51-
await admZip.writeZip(filename);
51+
admZip.writeZip(filename);
5252
};
5353

5454
/**
@@ -67,7 +67,7 @@ const zip = async(input: string, outputDir: string, platform: string, version: s
6767
if (platform === Platform.Linux) {
6868
await zipPosix(outputDir, filename);
6969
} else {
70-
await zipWindows(input, filename);
70+
zipWindows(input, filename);
7171
}
7272
return filename;
7373
};

0 commit comments

Comments
 (0)