Skip to content

Commit 206929e

Browse files
committed
keep deploying binary of app
1 parent eabdfc2 commit 206929e

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

bin/builders/BaseBuilder.ts

+15-1
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,14 @@ export default abstract class BaseBuilder {
8989
const fileType = this.getFileType(target);
9090
const appPath = this.getBuildAppPath(npmDirectory, fileName, fileType);
9191
const distPath = path.resolve(`${name}.${fileType}`);
92+
const appBinaryPath = this.getBuildAppBinaryPath(npmDirectory, name);
93+
const binaryExtension = process.platform === "win32" ? ".exe" : "";
94+
const distBinaryPath = path.resolve(`${name}${binaryExtension}`);
9295
await fsExtra.copy(appPath, distPath);
96+
await fsExtra.copy(appBinaryPath, distBinaryPath);
9397
await fsExtra.remove(appPath);
9498
logger.success('✔ Build success!');
95-
logger.success('✔ App installer located in', distPath);
99+
logger.success(`✔ App installer located in ${distPath}, App binary located in ${distBinaryPath}`);
96100
}
97101

98102
protected getFileType(target: string): string {
@@ -111,7 +115,17 @@ export default abstract class BaseBuilder {
111115
return `src-tauri/target/${basePath}/bundle/`;
112116
}
113117

118+
protected getBaseBinaryPath(): string {
119+
return 'src-tauri/target/release/';
120+
}
121+
114122
protected getBuildAppPath(npmDirectory: string, fileName: string, fileType: string): string {
115123
return path.join(npmDirectory, this.getBasePath(), fileType.toLowerCase(), `${fileName}.${fileType}`);
116124
}
125+
126+
protected getBuildAppBinaryPath(npmDirectory: string, fileName: string): string {
127+
// binary extension, ".exe" for windows, "" for *nix
128+
const binaryExtension = process.platform === "win32" ? ".exe" : "";
129+
return path.join(npmDirectory, this.getBaseBinaryPath(), `${fileName}${binaryExtension}`);
130+
}
117131
}

dist/cli.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -722,10 +722,14 @@ class BaseBuilder {
722722
const fileType = this.getFileType(target);
723723
const appPath = this.getBuildAppPath(npmDirectory, fileName, fileType);
724724
const distPath = path.resolve(`${name}.${fileType}`);
725+
const appBinaryPath = this.getBuildAppBinaryPath(npmDirectory, name);
726+
const binaryExtension = process.platform === "win32" ? ".exe" : "";
727+
const distBinaryPath = path.resolve(`${name}${binaryExtension}`);
725728
await fsExtra.copy(appPath, distPath);
729+
await fsExtra.copy(appBinaryPath, distBinaryPath);
726730
await fsExtra.remove(appPath);
727731
logger.success('✔ Build success!');
728-
logger.success('✔ App installer located in', distPath);
732+
logger.success(`✔ App installer located in ${distPath}, App binary located in ${distBinaryPath}`);
729733
}
730734
getFileType(target) {
731735
return target;
@@ -738,9 +742,17 @@ class BaseBuilder {
738742
const basePath = this.options.debug ? 'debug' : 'release';
739743
return `src-tauri/target/${basePath}/bundle/`;
740744
}
745+
getBaseBinaryPath() {
746+
return 'src-tauri/target/release/';
747+
}
741748
getBuildAppPath(npmDirectory, fileName, fileType) {
742749
return path.join(npmDirectory, this.getBasePath(), fileType.toLowerCase(), `${fileName}.${fileType}`);
743750
}
751+
getBuildAppBinaryPath(npmDirectory, fileName) {
752+
// binary extension, ".exe" for windows, "" for *nix
753+
const binaryExtension = process.platform === "win32" ? ".exe" : "";
754+
return path.join(npmDirectory, this.getBaseBinaryPath(), `${fileName}${binaryExtension}`);
755+
}
744756
}
745757

746758
class MacBuilder extends BaseBuilder {

0 commit comments

Comments
 (0)