This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 975
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #7915 Auditors: @aekeus leveldown uses prebuild and installs prebuilt binaries. But it doesn't check the env variable properly, or it was uploaded wrongly. This forces a rebuild if it is ia32
- Loading branch information
Showing
2 changed files
with
33 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,40 @@ | ||
var os = require('os') | ||
var path = require('path') | ||
var execute = require('./lib/execute') | ||
const os = require('os') | ||
const path = require('path') | ||
const execute = require('./lib/execute') | ||
|
||
console.log('Patching electron-builder native modules, please wait...') | ||
|
||
var braveGyp = path.join(os.homedir(), '.brave-gyp') | ||
var env = { | ||
const braveGyp = path.join(os.homedir(), '.brave-gyp') | ||
const env = { | ||
HOME: braveGyp, | ||
APPDATA: braveGyp | ||
} | ||
|
||
var rebuildCmd = '"../.bin/node-gyp" rebuild' | ||
const rebuildCmd = '"../.bin/node-gyp" rebuild' | ||
|
||
var cmds = [ | ||
'cp .npmrc ./node_modules/macos-alias', | ||
'cp .npmrc ./node_modules/fs-xattr', | ||
'cd ./node_modules/macos-alias', | ||
rebuildCmd, | ||
'cd ../fs-xattr', | ||
rebuildCmd | ||
] | ||
const isDarwin = process.platform === 'darwin' | ||
|
||
const cmds = [] | ||
if (process.env.TARGET_ARCH === 'ia32') { | ||
cmds.push( | ||
'cp .npmrc ./node_modules/leveldown', | ||
'cd ./node_modules/leveldown', | ||
// leveldown prebuild isn't respecting the npm_config_arch env | ||
// for some reason, so always compile it. | ||
'npm run rebuild' | ||
) | ||
} | ||
|
||
if (isDarwin) { | ||
cmds.push( | ||
'cd ..', | ||
'cp .npmrc ./node_modules/macos-alias', | ||
'cp .npmrc ./node_modules/fs-xattr', | ||
'cd ./node_modules/macos-alias', | ||
rebuildCmd, | ||
'cd ../fs-xattr', | ||
rebuildCmd | ||
) | ||
} | ||
|
||
execute(cmds, env, console.log.bind(null, 'done')) |
3092401
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++