Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. const gulp = require('gulp');
  2. const zip = require('gulp-zip');
  3. const fs = require('fs');
  4. var del = require('del');
  5.  
  6. const EB_CONFIG = './eb.config.json';
  7.  
  8. gulp.task('clear', function(cb) {
  9. return del(['dist', 'eb'], cb);
  10. });
  11.  
  12. gulp.task('prep', function() {
  13. return gulp.src(['./**/*', '!./node_modules/', '!./node_modules/**/*']) // Gets all files ending with .scss in app/scss and children dirs
  14. .pipe(gulp.dest('dist'))
  15. });
  16.  
  17. gulp.task('eb', ['clear', 'prep'], () => {
  18. const config = require(EB_CONFIG);
  19. let version = config.version.split('.').map((n) => parseInt(n));
  20. ++version[0];
  21. config.version = version.join('.');
  22. fs.writeFileSync(EB_CONFIG, JSON.stringify(config));
  23.  
  24. return gulp.src('dist/*')
  25. .pipe(zip(config.archive_name + '.v' + config.version + '.zip'))
  26. .pipe(gulp.dest('eb'));
  27. });
  28.  
  29. [11:18:29] Using gulpfile ~/Documents/repos/wonderWorldAPI/gulpfile.js
  30. [11:18:29] Starting 'clear'...
  31. [11:18:29] Starting 'prep'...
  32. [11:18:29] Starting 'zip'...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement