-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
41 lines (36 loc) · 1.24 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
const pinfo = require("./package.json");
const gulp = require("gulp");
const replace = require("gulp-replace");
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("eduadmin-version", function () {
return gulp
.src("src/eduadmin-nets-easy-integration.php")
.pipe(replace("$PLUGINVERSION$", pinfo.version))
.pipe(replace("$PLUGINATLEAST$", pinfo.config.eduadmin.requiresAtLeast))
.pipe(replace("$PLUGINTESTEDTO$", pinfo.config.eduadmin.testedUpTo))
.pipe(gulp.dest("./"));
});
gulp.task("default", function () {
gulp.watch("src/eduadmin-nets-easy-integration.php", gulp.series("eduadmin-version"));
gulp.watch("src/readme.md", gulp.series("readme-version"));
})
gulp.task(
"debug",
gulp.series(
"readme-version",
"eduadmin-version"
)
)