Repository navigation
Expand file tree
/
Copy pathgulpfile.js
More file actions
72 lines (66 loc) · 1.75 KB
/
Copy pathgulpfile.js
File metadata and controls
72 lines (66 loc) · 1.75 KB
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
68
69
70
71
72
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/**',
'!./.github/**',
'!./.claude/**',
'!./**/.gitignore',
'!./**/*.md',
'!./**/*.scss',
'!./**/tailwind-input.css',
'!./**/composer.json',
'!./**/tailwind.config.js',
'!./**/auth.json',
'!./**/.gitignore',
'!./**/LICENSE',
'!./**/phpunit*',
'!./tests/**',
'!./node_modules/**',
'!./build/**',
'!./doc/**',
'!./gulpfile.js',
'!./package.json',
'!./package-lock.json',
'!./composer.json',
'!./composer.lock',
'!./phpcs.xml',
'!./LICENSE',
'!./README.md',
'!./CLAUDE.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);