Skip to content

Commit

Permalink
desktop building process now makes zip packages
Browse files Browse the repository at this point in the history
  • Loading branch information
renatopp committed Nov 1, 2015
1 parent b6f3815 commit 820bb66
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ node_modules
# Custom
bower_components
dist
.temp-dist
build
src/vendor
cache
Expand Down
20 changes: 16 additions & 4 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ var minifyHTML = require('gulp-minify-html');
var connect = require('gulp-connect');
var less = require('gulp-less');
var jshint = require('gulp-jshint');
// var electron = require('gulp-atom-shell');
var foreach = require("gulp-foreach");
var zip = require("gulp-zip");
var packager = require('electron-packager');
var templateCache = require('gulp-angular-templatecache');
var replace = require('gulp-replace');
var stylish = require('jshint-stylish');
var exec = require('child_process').exec;
var fs = require('fs');
var rimraf = require('rimraf');
var merge = require('merge-stream');

// VARIABLES ==================================================================
Expand Down Expand Up @@ -214,21 +216,31 @@ gulp.task('_watch', ['_livereload'], function() {
gulp.task('_electron', ['build'], function(cb) {
packager({
dir : 'build',
out : 'dist',
out : '.temp-dist',
name : project.name,
platform : 'linux,win32',
arch : 'all',
version : '0.34.2',
overwrite : true,
asar : true
}, function done (err, appPath) {
}, function done(err, appPath) {
cb(err);
})
});

gulp.task('_electron_zip', ['_electron'], function() {
return gulp.src('.temp-dist/*')
.pipe(foreach(function(stream, file) {
var fileName = file.path.substr(file.path.lastIndexOf("/")+1);
gulp.src('.temp-dist/'+fileName+'/**/*')
.pipe(zip(fileName+'.zip'))
.pipe(gulp.dest('./dist'));
return stream;
}));
});

// COMMANDS ===================================================================
gulp.task('build', ['_vendor', '_preload', '_app_build']);
gulp.task('dev', ['_vendor', '_preload', '_app_dev']);
gulp.task('serve', ['_vendor', '_preload', '_app_dev', '_watch']);
gulp.task('dist', ['_electron']);
gulp.task('dist', ['_electron_zip']);
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"gulp-angular-templatecache": "~1.7.0",
"gulp-concat": "~2.6.0",
"gulp-connect": "~2.2.0",
"gulp-foreach": "^0.1.0",
"gulp-jshint": "~1.11.2",
"gulp-less": "~3.0.3",
"gulp-minify-css": "~1.2.1",
Expand All @@ -21,7 +22,8 @@
"gulp-uglify": "~1.4.1",
"gulp-zip": "^3.0.2",
"jshint-stylish": "~2.0.1",
"merge-stream": "~1.0.0"
"merge-stream": "~1.0.0",
"rimraf": "^2.4.3"
},
"dependencies": {}
}

0 comments on commit 820bb66

Please sign in to comment.