@@ -89,10 +89,14 @@ export default abstract class BaseBuilder {
89
89
const fileType = this . getFileType ( target ) ;
90
90
const appPath = this . getBuildAppPath ( npmDirectory , fileName , fileType ) ;
91
91
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 } ` ) ;
92
95
await fsExtra . copy ( appPath , distPath ) ;
96
+ await fsExtra . copy ( appBinaryPath , distBinaryPath ) ;
93
97
await fsExtra . remove ( appPath ) ;
94
98
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 } ` ) ;
96
100
}
97
101
98
102
protected getFileType ( target : string ) : string {
@@ -111,7 +115,17 @@ export default abstract class BaseBuilder {
111
115
return `src-tauri/target/${ basePath } /bundle/` ;
112
116
}
113
117
118
+ protected getBaseBinaryPath ( ) : string {
119
+ return 'src-tauri/target/release/' ;
120
+ }
121
+
114
122
protected getBuildAppPath ( npmDirectory : string , fileName : string , fileType : string ) : string {
115
123
return path . join ( npmDirectory , this . getBasePath ( ) , fileType . toLowerCase ( ) , `${ fileName } .${ fileType } ` ) ;
116
124
}
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
+ }
117
131
}
0 commit comments