Skip to content

Commit 271abe7

Browse files
committed
Remove the dependency on "gulp-replace"
1 parent cbad0c3 commit 271abe7

File tree

3 files changed

+476
-188
lines changed

3 files changed

+476
-188
lines changed

gulpfile.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import {cp} from "node:fs/promises";
1+
import {cp, readFile, writeFile} from "node:fs/promises";
22
import {env} from "node:process";
33
import {deleteAsync} from "del";
44
import esbuild from "esbuild";
55
import {$} from "execa";
66
import gulp from "gulp";
7-
import replace from "gulp-replace";
87
import pkg from "./package.json" with {type: "json"};
98

109
export async function build() {
@@ -56,10 +55,9 @@ export function test() {
5655
}
5756

5857
// Updates the version number in the sources.
59-
export function version() {
60-
return gulp.src("README.md")
61-
.pipe(replace(/action\/v\d+(\.\d+){2}/, `action/v${pkg.version}`))
62-
.pipe(gulp.dest("."));
58+
export async function version() {
59+
const file = "README.md";
60+
return writeFile(file, (await readFile(file, "utf8")).replace(/action\/v\d+(\.\d+){2}/, `action/v${pkg.version}`));
6361
}
6462

6563
// The default task.

0 commit comments

Comments
 (0)