-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgulpfile.js
67 lines (61 loc) · 1.7 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
const gulp = require( 'gulp' ),
del = require( 'del' ),
wpPot = require( 'gulp-wp-pot' ),
zip = require( 'gulp-zip' );
const { series, parallel } = require( 'gulp' );
// Pot Path
var potPath = [ './*.php', 'includes/*.php', 'includes/**/*.php', 'admin/*.php', 'admin/**/*.php', 'cli/*.php' ];
// ZIP Path
var zipPath = [
'./',
'./**',
'./**',
'!./.git/**',
'!./**/.gitignore',
'!./**/*.md',
'!./**/*.scss',
'!./**/tailwind-input.css',
'!./**/composer.json',
'!./**/auth.json',
'!./**/.gitignore',
'!./**/LICENSE',
'!./**/phpunit*',
'!./tests/**',
'!./node_modules/**',
'!./build/**',
'!./gulpfile.js',
'!./package.json',
'!./package-lock.json',
'!./composer.json',
'!./composer.lock',
'!./phpcs.xml',
'!./LICENSE',
'!./README.md',
'!./vendor/bin/**',
'!./vendor/**/*.txt',
'!./includes/file-manager/instawp*.php',
'!./includes/database-manager/instawp*.php',
];
// Clean CSS, JS and ZIP
function clean_files() {
let cleanPath = [ '../instawp-connect.zip' ];
return del( cleanPath, { force : true } );
}
// Create POT file
function create_pot() {
return gulp.src( potPath )
.pipe( wpPot( {
domain: 'instawp-connect',
package: 'InstaWP Connect',
copyrightText: 'InstaWP',
ignoreTemplateNameHeader: true
} ) )
.pipe( gulp.dest( 'languages/instawp-connect.pot' ) );
}
// Create ZIP file
function create_zip() {
return gulp.src( zipPath, { base : '../' } )
.pipe( zip( 'instawp-connect.zip' ) )
.pipe( gulp.dest( '../' ) )
}
exports.default = series( clean_files, create_pot, create_zip );