-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
81 lines (73 loc) · 2.18 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/**
* Server Info Plugin
* Gulp Main File
*
*/
'use strict';
var gulp = require('gulp');
var zip = require('gulp-zip');
var notify = require('gulp-notify');
var wpPot = require('gulp-wp-pot');
var sort = require('gulp-sort');
var projectPHPWatchFiles = './**/*.php';
var translatePath = './languages/'
var text_domain = 'si';
var destFile = 'server-info.pot';
var packageName = 'server-info';
var bugReport = 'https://github.com/usmanaliqureshi/server-info/issues';
var lastTranslator = 'Usman Ali Qureshi <[email protected]>';
var team = 'InspiryThemes <[email protected]>';
gulp.task('translate', function () {
return gulp.src(projectPHPWatchFiles)
.pipe(sort())
.pipe(wpPot({
domain: text_domain,
destFile: destFile,
package: packageName,
bugReport: bugReport,
lastTranslator: lastTranslator,
team: team
}))
.pipe(gulp.dest(translatePath + destFile))
.pipe(notify({message: 'TASK: "translate" Completed!', onLast: true}))
});
gulp.task('zip', gulp.parallel(['translate'], function () {
return gulp.src([
// Include
'./**/*',
// Exclude
'!./prepros.cfg',
'!./README.md',
'!./server-info.zip',
'!./**/.DS_Store',
'!./sass/**/*.scss',
'!./sass',
'!./node_modules/**',
'!./node_modules',
'!./wp-assets',
'!./wp-assets/**',
'!./old-versions',
'!./old-versions/**',
'!./package.json',
'!./package-lock.json',
'!./gulpfile.js',
'!./*.sublime-project',
'!./*.sublime-workspace'
])
.pipe(zip('server-info.zip'))
.pipe(gulp.dest('./'))
.pipe(notify({
message: 'TASK: Server Info plugin ZIP Package is ready to go.',
onLast: true
}));
}));
/**
* - Running All the TASKS -
* ZIP task is depending on the translate task so no need to call the translate task as it will automatically run first before ZIP task.
*/
gulp.task('default', gulp.parallel(['zip'], function() {
notify({
message: 'TASK: Server Info plugin ZIP Package is ready to go.',
onLast: true
});
}));