Skip to content

Commit 14cb14a

Browse files
committed
Added 'npm run zip'
1 parent 679b042 commit 14cb14a

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

gulpfile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ var jsSourcePath = './src/js/'; // Path to source JavaScript files
2727
var styleDestination = './assets/css/'; // Path to place the compiled CSS file
2828
var jsDestination = './assets/js/'; // Path to place the compiled CSS file
2929
var styleMapPath = './'; // Path to place the map files
30+
var distZipFile = project + '.zip'; // The destination file for the ZIP task
3031

3132
/* Define the main CSS files to watch */
3233
var styleTasks = [
@@ -59,7 +60,6 @@ var jsTasks = [
5960
}
6061
];
6162

62-
6363
/* Define strings to replace using 'gelp rename', defined in the config section of package.json */
6464
var renameStrings = [
6565
[ 'dmhendricks\/wordpress-base-plugin', pkg.config.username + '/' + pkg.name ], // Git/Composer identifier
@@ -112,7 +112,7 @@ var filter = require('gulp-filter'); // Enables you to work on a subset of
112112
var sourcemaps = require('gulp-sourcemaps'); // Maps code in a compressed file (E.g. style.css) back to it’s original position in a source file (E.g. structure.scss, which was later combined with other css files to generate style.css)
113113
var notify = require('gulp-notify'); // Displays notification message
114114
var batchRename = require('gulp-simple-rename'); // Rename files with wildcard
115-
var vinylPaths = require('vinyl-paths');
115+
var vinylPaths = require('vinyl-paths'); // Return each path in a stream
116116
var del = require('del'); // Delete files that are renamed
117117

118118
/* Arrays to hold created task info */

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"javascript_object": "WPBP_NS"
99
},
1010
"scripts": {
11-
"translate": "wp-pot -s 'app/**/*.php' -o ./languages/$npm_package_name.pot -p $npm_package_config_slug"
11+
"translate": "wp-pot -s 'app/**/*.php' -o ./languages/$npm_package_name.pot -p $npm_package_config_slug",
12+
"zip": "zip -q -r ../$npm_package_name.zip * -x 'node_modules/*' '.git*' './src/*' './.*' './package*.*' './composer.*' './*.md' './bower.json' './gulpfile.js' "
1213
},
1314
"devDependencies": {
1415
"gulp": "^3.9.1",

0 commit comments

Comments
 (0)