-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
63 lines (58 loc) · 1.52 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
const gulp = require('gulp');
const del = require('del');
const {zip} = require('gulp-vinyl-zip');
const files = [
'**/*',
'*',
'!composer.phar',
'!sso-flarum.zip',
'!wp-cli.phar',
'!yarn-error.log',
'!**/svn',
'!**/svn/**/*',
'!**/node_modules/',
'!**/node_modules/**/*',
'!**/vendor/bin',
'!**/vendor/bin/**/*',
'!**/vendor/maicol07/flarum-api-client/docs',
'!**/vendor/maicol07/flarum-api-client/docs/**/*',
'!**/vendor/maicol07/flarum-sso-plugin/docs',
'!**/vendor/maicol07/flarum-sso-plugin/docs/**/*',
'!**/vendor/maicol07/flarum-sso-plugin/documentation',
'!**/vendor/maicol07/flarum-sso-plugin/documentation/**/*',
'!**/vendor/maicol07/flarum-sso-plugin/example',
'!**/vendor/maicol07/flarum-sso-plugin/example/**/*',
'!**/vendor/squizlabs',
'!**/vendor/squizlabs/**/*',
'!**/vendor/wp-coding-standards',
'!**/vendor/wp-coding-standards/**/*'
];
/**
* Clean (deletes) the build and dist directories
*
* @returns {*}
*/
function clean() {
return del('sso-flarum.zip');
}
/**
* Create the build directory with the required files for release
*
* @returns {*}
*/
function pack() {
return gulp.src(files).pipe(zip('sso-flarum.zip'))
.pipe(gulp.dest('./'));
}
/**
* Copy the build directory contents to svn (to push to SVN repo)
*
* @returns {*}
*/
function copy_svn() {
return gulp.src(files.concat(['!**/vendor/symfony/polyfill-mbstring/bootstrap80.php'])).pipe(gulp.dest('svn'));
}
exports.default = gulp.series(clean, pack, copy_svn);
exports.clean = clean;
exports.zip = pack;
exports.copy_svn = copy_svn;