Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Commit

Permalink
Gulp package task added
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-marshall committed Dec 8, 2015
1 parent 2a59f61 commit 4811705
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
28 changes: 28 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/*jslint node: true */
"use strict";

var $ = require('gulp-load-plugins')();
var argv = require('yargs').argv;
var gulp = require('gulp');
Expand Down Expand Up @@ -57,6 +60,19 @@ var PATHS = {

// Include your own custom scripts (located in the custom folder)
'assets/javascript/custom/*.js'
],
pkg: [
'**/*',
'!**/node_modules/**',
'!**/components/**',
'!**/scss/**',
'!**/bower.json',
'!**/Gruntfile.js',
'!**/package.json',
'!**/composer.json',
'!**/composer.lock',
'!**/codesniffer.ruleset.xml',
'!**/packaged/*'
]
};

Expand Down Expand Up @@ -135,6 +151,18 @@ gulp.task('copy', function() {
return merge(motionUi, whatInput, fontAwesome);
});

// Package task
gulp.task('package', ['build'], function() {
var fs = require('fs');
var pkg = JSON.parse(fs.readFileSync('./package.json'));
var time = $.util.date(new Date(), '_yyyy-mm-dd_HH-MM');
var title = pkg.name + time + '.zip';

return gulp.src(PATHS.pkg)
.pipe($.zip(title))
.pipe(gulp.dest('packaged'));
});

// Build task
// Runs copy then runs sass & javascript in parallel
gulp.task('build', function(done) {
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,17 @@
"gulp-uglify": "^1.5.1",
"gulp-uncss": "^1.0.4",
"gulp-util": "^3.0.7",
"gulp-zip": "^3.0.2",
"merge-stream": "^1.0.0",
"motion-ui": "^1.1.0",
"run-sequence": "^1.1.5",
"yargs": "^3.31.0"
},
"scripts": {
"build": "gulp build",
"watch": "gulp",
"package": "gulp package"
"postinstall": "bower install && gulp build",
"production": "gulp --production"
"production": "gulp --production",
"watch": "gulp"
}
}

0 comments on commit 4811705

Please sign in to comment.