-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
58 lines (49 loc) · 1.46 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
const gulp = require("gulp");
const replace = require("gulp-replace");
const pinfo = require("./package.json");
/* Debug */
gulp.task("readme-version", function () {
return gulp
.src("src/README.md")
.pipe(replace("$PLUGINVERSION$", pinfo.version))
.pipe(replace("$PLUGINATLEAST$", pinfo.config.eduadmin.requiresAtLeast))
.pipe(replace("$PLUGINTESTEDTO$", pinfo.config.eduadmin.testedUpTo))
.pipe(
replace(
"$PLUGINREQUIREDPHP$",
pinfo.config.eduadmin.minimumPhpVersion
)
)
.pipe(gulp.dest("./"));
});
gulp.task("plugin-version", function () {
return gulp
.src("src/eduadmin-wordpress-sveawebpay.php")
.pipe(replace("$PLUGINVERSION$", pinfo.version))
.pipe(replace("$PLUGINATLEAST$", pinfo.config.eduadmin.requiresAtLeast))
.pipe(replace("$PLUGINTESTEDTO$", pinfo.config.eduadmin.testedUpTo))
.pipe(gulp.dest("./"));
});
/* Deploy */
gulp.task("default", function () {
gulp.watch("src/eduadmin-wordpress-sveawebpay.php", gulp.series("plugin-version"));
gulp.watch("src/README.md", gulp.series("readme-version"));
gulp.watch(
"package.json",
gulp.series("readme-version", "plugin-version")
);
});
gulp.task(
"debug",
gulp.series(
"readme-version",
"plugin-version"
)
);
gulp.task(
"deploy",
gulp.series(
"readme-version",
"plugin-version"
)
);