'use strict';

var gulp = require('gulp');
var shell = require('gulp-shell')
var sass = require('gulp-sass');
var electron = require('electron-connect').server.create();

gulp.task('serve', function () {

  // Compile the sass
  gulp.start('sass');

  // Start browser process
  electron.start();

  // Restart browser process
  gulp.watch('main.js', electron.restart);

  // Reload renderer process
  gulp.watch(['index.js', 'index.html', 'index.scss'], function(){
    gulp.start('sass');
    electron.reload()
  });
});

gulp.task('build', shell.task([
  'electron-packager . --overwrite --platform=darwin --icon=assets/icons/mac/icon.icns --arch=x64 --prune=true --out=release_builds'
]))

gulp.task('sass', function () {
  return gulp.src('./*.scss')
    .pipe(sass().on('error', sass.logError))
    .pipe(gulp.dest('./'));
});

@@ -162,16 +162,61 @@
 reate();
+%0Avar package_info = require('./package.json')
 %0A%0Agulp.t
@@ -578,16 +578,158 @@
 k('build
+-all', shell.task(%5B%0A  'electron-packager . --overwrite --platform=all --arch=all --prune=true --out=release_builds'%0A%5D));%0A%0Agulp.task('build-mac
 ', shell
@@ -872,16 +872,228 @@
 lds'%0A%5D))
+;%0A%0Agulp.task('zip', shell.task(%5B%0A  %60zip -FSr release_builds/opsdroid-desktop-darwin-x64/opsdroid-desktop-$%7Bpackage_info.version%7D-macos-x64.zip release_builds/opsdroid-desktop-darwin-x64/opsdroid-desktop.app%60%0A%5D));
 %0A%0Agulp.t

Make builds platform specific and add zipping