Skip to content

Commit

Permalink
Remove the dependency on "gulp-replace"
Browse files Browse the repository at this point in the history
  • Loading branch information
cedx committed Jun 15, 2024
1 parent cbad0c3 commit 271abe7
Show file tree
Hide file tree
Showing 3 changed files with 476 additions and 188 deletions.
10 changes: 4 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import {cp} from "node:fs/promises";
import {cp, readFile, writeFile} from "node:fs/promises";
import {env} from "node:process";
import {deleteAsync} from "del";
import esbuild from "esbuild";
import {$} from "execa";
import gulp from "gulp";
import replace from "gulp-replace";
import pkg from "./package.json" with {type: "json"};

export async function build() {
Expand Down Expand Up @@ -56,10 +55,9 @@ export function test() {
}

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

// The default task.
Expand Down
Loading

0 comments on commit 271abe7

Please sign in to comment.