var packager = require('electron-packager')
var assign = require('object-assign')

var DEFAULT_OPTS = {
  version: '0.26.1',
  dir: './',
  name: 'ElectronReact'
}

var MacOS_OPTS = assign({}, DEFAULT_OPTS, {
  platform: 'darwin',
  arch: 'x64',
  out: 'release/darwin',
})

var Linux_OPTS = assign({}, DEFAULT_OPTS, {
  platform: 'linux',
  arch: 'x64',
  out: 'release/linux',
})

var Windows_OPTS = assign({}, DEFAULT_OPTS, {
  platform: 'win32',
  arch: 'x64',
  out: 'release/win32',
})


pack(MacOS_OPTS, thenPack(Linux_OPTS, thenPack(Windows_OPTS, log)))


function pack(opts, cb) {
  packager(opts, cb)
}

function thenPack(opts, cb) {
  return function() {
    packager(opts, cb)
  }
}

function log(err, filepath) {
  if (err) return console.error(err)
  console.log('finished!')
}

@@ -75,16 +75,86 @@
 ssign')%0A
+var devDeps = Object.keys(require('./package.json').devDependencies)%0A%0A
 %0Avar DEF
@@ -182,17 +182,17 @@
 on: '0.2
-6
+7
 .1',%0A  d
@@ -224,16 +224,171 @@
 onReact'
+,%0A  ignore: %5B%0A    '/test($%7C/)',%0A    '/tools($%7C/)',%0A    '/release($%7C/)'%0A  %5D.concat(devDeps.map(function(name) %7B return '/node_modules/' + name + '($%7C/)' %7D))
 %0A%7D%0A%0Avar 

add test, tools, ignore, release, and dev dependencies to package ignore