var fs = require('fs')
var exec = require('child_process').exec

var pack = JSON.parse(fs.readFileSync('package.json', 'utf-8'))
var version = pack.version

console.log('Building version ' + version + ' in Brave-darwin-x64')

var cmd = 'rm -rf Brave-darwin-x64 && NODE_ENV=production ./node_modules/webpack/bin/webpack.js && rm -f dist/Brave.dmg && ./node_modules/electron-packager/cli.js . Brave --overwrite --ignore="electron-download|electron-rebuild|electron-packager|electron-builder|electron-prebuilt|electron-rebuild|babel-|babel" --platform=darwin --arch=x64 --version=0.35.1 --icon=res/app.icns --app-version=' + version

console.log(cmd)

exec(cmd, function (err, stdout, stderr) {
  if (err) console.error(err)
  console.log(stdout)
})

@@ -58,16 +58,35 @@
 ).exec%0A%0A
+// get our version%0A
 var pack
@@ -161,32 +161,225 @@
 = pack.version%0A%0A
+// get the electron version%0Avar electronPrebuiltPack = JSON.parse(fs.readFileSync('./node_modules/electron-prebuilt/package.json', 'utf-8'))%0Avar electronVersion = electronPrebuiltPack.version%0A%0A
 console.log('Bui
@@ -427,17 +427,50 @@
 rwin-x64
-'
+ with Electron ' + electronVersion
 )%0A%0Avar c
@@ -471,18 +471,23 @@
 %0Avar cmd
+s
  =
+ %5B%0A 
  'rm -rf
@@ -503,20 +503,22 @@
 rwin-x64
- && 
+',%0A  '
 NODE_ENV
@@ -566,20 +566,22 @@
 bpack.js
- && 
+',%0A  '
 rm -f di
@@ -596,12 +596,14 @@
 .dmg
- && 
+',%0A  '
 ./no
@@ -782,15 +782,48 @@
 abel
--
+$
 %7Cbabel
+-(?!polyfill%7Cregenerator-runtime)
 %22 --
@@ -863,14 +863,31 @@
 ion=
-0.35.1
+' + electronVersion + '
  --i
@@ -924,24 +924,55 @@
 =' + version
+%0A%5D%0A%0Avar cmd = cmds.join(' && ')
 %0A%0Aconsole.lo

Use Electron Prebuilt version from package.json