-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update maintaining-dependencies.md on major v8 update (#699)
- Loading branch information
1 parent
e7b2fea
commit a8b1812
Showing
2 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { promises as fs } from 'node:fs'; | ||
import { getNodeV8Version } from './util.js'; | ||
|
||
export default function updateMaintainingDependencies() { | ||
return { | ||
title: 'Update V8 version in maintaining-dependencies.md', | ||
task: async(ctx) => { | ||
const path = `${ctx.nodeDir}/doc/contributing/maintaining/maintaining-dependencies.md`; | ||
let maintainingDependenciesMd = await fs.readFile(path, 'utf8'); | ||
const v8Version = (await getNodeV8Version(ctx.nodeDir)).toString(); | ||
const v8VersionNoDots = v8Version.replaceAll('.', ''); | ||
// V8 itemlist link | ||
maintainingDependenciesMd = maintainingDependenciesMd.replace( | ||
/\* \[V8.*/, | ||
`* [V8 ${v8Version}][]` | ||
); | ||
// V8 link to section | ||
maintainingDependenciesMd = maintainingDependenciesMd.replace( | ||
/\[v8.*\]: #v8.*/, | ||
`[v8 ${v8Version}]: #v8-${v8VersionNoDots}` | ||
); | ||
// V8 section title | ||
maintainingDependenciesMd = maintainingDependenciesMd.replace( | ||
/### V8.*/, | ||
`### V8 ${v8Version}` | ||
); | ||
await fs.writeFile(path, maintainingDependenciesMd); | ||
await ctx.execGitNode( | ||
'add', | ||
['doc/contributing/maintaining/maintaining-dependencies.md'] | ||
); | ||
} | ||
}; | ||
}; |