11// This is a test edit from the Github iOS app
22
3- import fs from "fs" ;
43import todo from "todo" ;
54import date from "./date.ts" ;
65import downloadPages from "./downloadPages.ts" ;
@@ -92,10 +91,7 @@ for (const login of logins) {
9291 followers . push ( { login, followed_at, unfollowed_at } ) ;
9392}
9493
95- await fs . promises . writeFile (
96- "followers.json" ,
97- JSON . stringify ( followers , null , 2 )
98- ) ;
94+ await Bun . write ( "followers.json" , JSON . stringify ( followers , null , 2 ) ) ;
9995
10096// Keep a list of accounts found to be dead to skip in unfollow-follow events
10197const deadLogins : string [ ] = [ ] ;
@@ -211,7 +207,7 @@ for (const [field, order] of [
211207 markdown += `📒 ${ repository . description } \n\n` ;
212208 }
213209
214- await fs . promises . writeFile ( `by-${ field } -${ order } .md` , markdown ) ;
210+ await Bun . write ( `by-${ field } -${ order } .md` , markdown ) ;
215211 console . groupEnd ( ) ;
216212}
217213
@@ -314,7 +310,7 @@ for (const repository of repositories) {
314310 }
315311
316312 content = Buffer . from ( content . content , "base64" ) ;
317- await fs . promises . writeFile ( name + "." + readme , content ) ;
313+ await Bun . write ( name + "." + readme , content ) ;
318314
319315 if ( ! todos [ name ] ) {
320316 todos [ name ] ??= { } ;
@@ -329,7 +325,7 @@ for (const repository of repositories) {
329325 todos [ name ] . todos . push ( text ) ;
330326 }
331327
332- await fs . promises . unlink ( name + "." + readme ) ;
328+ await Bun . file ( name + "." + readme ) . delete ( ) ;
333329 }
334330}
335331
@@ -339,13 +335,13 @@ for (const name in todos) {
339335 }
340336}
341337
342- await fs . promises . writeFile (
338+ await Bun . write (
343339 "todos.json" ,
344340 JSON . stringify ( Object . fromEntries ( Object . entries ( todos ) . sort ( ) ) , null , 2 )
345341) ;
346342
347343// Sort the repositories object by key before persisting it to the change
348- await fs . promises . writeFile (
344+ await Bun . write (
349345 "repositories.json" ,
350346 JSON . stringify (
351347 Object . fromEntries ( Object . entries ( _repositories ) . sort ( ) ) ,
@@ -423,7 +419,7 @@ const issuesMarkDown =
423419 )
424420 . join ( "\n\n" ) +
425421 "\n" ;
426- await fs . promises . writeFile ( "issues.md" , issuesMarkDown ) ;
422+ await Bun . write ( "issues.md" , issuesMarkDown ) ;
427423
428424const prs = issuesAndPrs
429425 . filter ( ( issueOrPr : any ) => issueOrPr . pull_request )
@@ -451,7 +447,7 @@ const prsMarkDown =
451447 )
452448 . join ( "\n\n" ) +
453449 "\n" ;
454- await fs . promises . writeFile ( "prs.md" , prsMarkDown ) ;
450+ await Bun . write ( "prs.md" , prsMarkDown ) ;
455451
456452const forkPrs = [
457453 ...( await downloadPages (
@@ -493,12 +489,12 @@ const identicalForksMarkDown =
493489 : identicalForks . length === 1
494490 ? `\n[One${ nbsp } identical${ nbsp } fork:${ nbsp } \`${ identicalForks [ 0 ] } \`${ nbsp } 🍴⚠️](${ process . env . GITHUB_SERVER_URL } /${ login } /${ identicalForks [ 0 ] } )`
495491 : `\n[${ identicalForks . length } ${ nbsp } identical${ nbsp } forks${ nbsp } 🍴⚠️](identical-forks.json)` ;
496- await fs . promises . writeFile (
492+ await Bun . write (
497493 "identical-forks.json" ,
498494 JSON . stringify ( identicalForks , null , 2 )
499495) ;
500496if ( identicalForks . length === 0 ) {
501- await fs . promises . unlink ( "identical-forks.json" ) ;
497+ await Bun . file ( "identical-forks.json" ) . delete ( ) ;
502498}
503499
504500const followerCount = followers . filter (
@@ -594,4 +590,4 @@ for (const event of events) {
594590markdown += "\n" ;
595591markdown += "</details>\n" ;
596592
597- await fs . promises . writeFile ( "readme.md" , markdown ) ;
593+ await Bun . write ( "readme.md" , markdown ) ;
0 commit comments