File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed
support/src/documentationHelpers Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ Thanks to these wonderful volunteers and contributors for improving the HackYour
44
55<!-- To update the contributor list, run "npm run generate:contributors" -->
66<!-- prettier-ignore-start -->
7- <!-- BEGIN generateContributors -->
7+ <!-- BEGIN generate:contributors -->
88
99Total: ** 16** contributors
1010
@@ -20,7 +20,7 @@ Total: **16** contributors
2020| --- | --- | --- | --- |
2121| [ @MercedesUbeira ] ( https://github.com/MercedesUbeira ) | [ @shpomp ] ( https://github.com/shpomp ) | [ @saloumeh-67 ] ( https://github.com/saloumeh-67 ) | [ @urbanogilson ] ( https://github.com/urbanogilson ) |
2222
23- <!-- END generateContributors -->
23+ <!-- END generate:contributors -->
2424<!-- prettier-ignore-end -->
2525
2626There are many people who help test, review and guide the development of our program behind the scenes without committing directly. Let's share a thanks for those people too 👏!
Original file line number Diff line number Diff line change @@ -156,7 +156,11 @@ async function main() {
156156 const raw = await fetchContributors ( REPO ) ;
157157 const contributors = filterAndSortContributors ( raw ) ;
158158 const md = renderMarkdown ( contributors ) ;
159- await updateFileSection ( md , "./contributing/contributors.md" ) ;
159+ await updateFileSection (
160+ md ,
161+ "./contributing/contributors.md" ,
162+ "generate:contributors" ,
163+ ) ;
160164 } catch ( err : any ) {
161165 console . error ( "Error:" , err . message ) ;
162166 process . exit ( 1 ) ;
Original file line number Diff line number Diff line change @@ -3,14 +3,16 @@ import * as fs from "node:fs/promises";
33export default async function updateFileSection (
44 contentToInsert : string ,
55 filename : string ,
6+ markerName : string ,
67) : Promise < void > {
78 const oldContent = await fs . readFile ( filename , "utf-8" ) ;
89
9- const matches = [
10- ...oldContent . matchAll (
11- / ( < ! - - B E G I N g e n e r a t e C o n t r i b u t o r s - - > ) .* ?( < ! - - E N D g e n e r a t e C o n t r i b u t o r s - - > ) / gs,
12- ) ,
13- ] ;
10+ const pattern = new RegExp (
11+ `(<!-- BEGIN ${ markerName } -->).*?(<!-- END ${ markerName } -->)` ,
12+ "gs" ,
13+ ) ;
14+
15+ const matches = [ ...oldContent . matchAll ( pattern ) ] ;
1416
1517 if ( matches . length !== 1 )
1618 throw new Error (
You can’t perform that action at this time.
0 commit comments