var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var packager = require('electron-packager');

gulp.task('compile', function(){
	return gulp.src('src/**/*.{js,jsx}')
		.pipe(
			$.babel({
				stage: 0
			})
		)
		.pipe(gulp.dest('js'));
});

var commonOption = {
		dir: './',
		out: 'release',
		name: 'TDUCTF-2015',
		arch: 'all',
		platform: 'all',
		ignore: [
			'\./node_modules/gulp*',
			'\./node_modules/electron*',
			'\./node_modules/semantic-ui',
			'\./node_modules/yamljs',
			'\./node_modules/.bin',
			'\./release/',
			'\./src/',
			'\./.git*'
		],
		version: '0.30.5'
}

gulp.task('package:darwin', ['compile'], function (done) {
	var option = commonOption;
	option.platform = 'darwin';
	option.arch = 'x64';
	option.icon = "app-icon.icns";
	packager(option, function (err, path) {
		done();
	});
});

gulp.task('package:linux:ia32', ['compile'], function (done) {
	var option = commonOption;
	option.platform = 'linux';
	option.arch = 'ia32';
	option.icon = "app-icon.png";
	packager(option, function (err, path) {
		done();
	});
});

gulp.task('package:linux:x64', ['compile'], function (done) {
	var option = commonOption;
	option.platform = 'linux';
	option.arch = 'x64';
	option.icon = "app-icon.png";
	packager(option, function (err, path) {
		done();
	});
});

gulp.task('package:win:ia32', ['compile'], function (done) {
	var option = commonOption;
	option.platform = 'win';
	option.arch = 'ia32';
	option.icon = "app-icon.ico";
	packager(option, function (err, path) {
		done();
	});
});

gulp.task('package:win:x64', ['compile'], function (done) {
	var option = commonOption;
	option.platform = 'win';
	option.arch = 'x64';
	option.icon = "app-icon.ico";
	packager(option, function (err, path) {
		done();
	});
});

gulp.task('package:all', ['compile'], function (done) {
	var option = commonOption;
	packager(option, function (err, path) {
		done();
	});
});


@@ -1784,82 +1784,118 @@
 ', %5B
-'compile'%5D, function (done) %7B%0A%09var option = commonOption;%0A%09packager(option
+%0A%09%09'package:darwin',%0A%09%09'package:linux:ia32',%0A%09%09'package:linux:x64',%0A%09%09'package:win:ia32',%0A%09%09'package:win:x64'%5D
 , fu
@@ -1898,38 +1898,32 @@
 , function (
-err, path
+done
 ) %7B%0A
-%09
 %09done();%0A%09%7D)
@@ -1911,26 +1911,21 @@
 one) %7B%0A%09done();%0A
-%09%7D);%0A
 %7D);%0A%0A

Change package:all method