@@ -5,7 +5,6 @@ import { homedir } from "os"
5
5
import * as path from "path"
6
6
import { Configuration } from "../configuration"
7
7
import { NodeModuleDirInfo } from "./packageDependencies"
8
- import { getElectronVersion } from "../electron/electronVersion"
9
8
import * as electronRebuild from "@electron/rebuild"
10
9
import * as searchModule from "@electron/rebuild/lib/src/search-module"
11
10
@@ -26,7 +25,7 @@ export async function installOrRebuild(config: Configuration, appDir: string, op
26
25
}
27
26
await installDependencies ( appDir , effectiveOptions )
28
27
} else {
29
- await rebuild ( appDir , config . buildDependenciesFromSource === true , options . arch )
28
+ await rebuild ( appDir , config . buildDependenciesFromSource === true , options . frameworkInfo , options . arch )
30
29
}
31
30
}
32
31
@@ -119,8 +118,8 @@ function installDependencies(appDir: string, options: RebuildOptions): Promise<a
119
118
} )
120
119
}
121
120
122
- export async function nodeGypRebuild ( arch : string ) {
123
- return rebuild ( process . cwd ( ) , false , arch )
121
+ export async function nodeGypRebuild ( frameworkInfo : DesktopFrameworkInfo , arch : string ) {
122
+ return rebuild ( process . cwd ( ) , false , frameworkInfo , arch )
124
123
}
125
124
126
125
function getPackageToolPath ( ) {
@@ -149,15 +148,15 @@ export interface RebuildOptions {
149
148
}
150
149
151
150
/** @internal */
152
- export async function rebuild ( appDir : string , buildFromSource : boolean , arch = process . arch ) {
153
- log . info ( { appDir, arch } , "executing @electron/rebuild" )
151
+ export async function rebuild ( appDir : string , buildFromSource : boolean , frameworkInfo : DesktopFrameworkInfo , arch = process . arch ) {
152
+ log . info ( { appDir, ...frameworkInfo } , "executing @electron/rebuild" )
153
+ const rootPath = await searchModule . getProjectRootPath ( appDir )
154
154
const options : electronRebuild . RebuildOptions = {
155
155
buildPath : appDir ,
156
- electronVersion : await getElectronVersion ( appDir ) ,
156
+ electronVersion : frameworkInfo . version ,
157
157
arch,
158
- force : true ,
159
158
debug : log . isDebugEnabled ,
160
- projectRootPath : await searchModule . getProjectRootPath ( appDir ) ,
159
+ projectRootPath : rootPath ,
161
160
}
162
161
if ( buildFromSource ) {
163
162
options . prebuildTagPrefix = "totally-not-a-real-prefix-to-force-rebuild"
0 commit comments