function buildZipUsingExec(arch, platform, filesToCompress) {
  const filename = `hain-${platform}-${arch}-v${appPkg.version}.zip`;
  const targetDir = `Hain-${platform}-${arch}`;
  const workingDir = path.join(__dirname, 'out', targetDir);
  return new Promise((resolve, reject) => {
    cp.exec(
      `zip --symlinks -r ../${filename} ${filesToCompress}`,
      {
        cwd: workingDir
      },
      (err, stdout, stderr) => {
        if (err) {
          console.log(stdout);
          console.log(stderr);
          return reject(err);
        }
        return resolve();
      }
    );
  });
}
/*.js*')
    .pipe(sourcemaps.init())
    .pipe(
      babel({
        presets: ['es2015', 'react']
      })
    )
    .pipe(sourcemaps.write())
    .pipe(gulp.dest('./app/renderer'));
  return js;
});

function build(arch, platform, icon) {
  return new Promise((resolve, reject) => {
    packager(
      {
        arch,
        name: 'Hain',
        dir: path.join(__dirname, 'app'),
        platform: platform || 'win32',
        asar: true,
        ignore: /(renderer-jsx|__tests__)/gi,
        overwrite: true,
        out: path.join(__dirname, 'out'),
        icon: path.join(__dirname, 'build', icon || 'icon.ico'),
        'version-string': {
          ProductName: 'Hain',
          CompanyName: 'Heejin Lee'
        }
      },
      (err) => {
        if (err) {
          console.log(err);
          return reject(err);
        }
        return resolve();
      }
    );
  });
}

function buildZip(arch) {
  const filename = `Hain-${arch}-v${appPkg.version}.zip`;
  return gulp
    .src(`./out/Hain-win32-${arch}/*