Skip to content

Commit 279a1b3

Browse files
committed
feat: update follower script
1 parent 84060a6 commit 279a1b3

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

scripts/src/fetchFollowers.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import dotenv from "dotenv";
22
dotenv.config();
33

4-
if(process.env.ACCESS_TOKEN === undefined){
4+
if (process.env.ACCESS_TOKEN === undefined) {
55
console.error("Please provide ACCESS_TOKEN in .env file");
66
process.exit(1);
77
}
@@ -42,8 +42,8 @@ async function main() {
4242
let readme = readFileSync(READMEFILE_PATH, "utf-8");
4343

4444
readme = readme.replace(
45-
/(?<=<!--START_SECTION:top-followers-heading-->\n### :sparkles: \[My followers \()(\d+)(?=\)\])/,
46-
`${followersLength}`
45+
/(?<=<!--START_SECTION:top-followers-heading-->\n)[\s\S]*(?=\n<!--End_SECTION:top-followers-heading-->)/,
46+
`\n### :sparkles: [My followers (${followersLength})](https://github.com/Pulkitxm?tab=followers)\n`
4747
);
4848

4949
readme = readme.replace(
@@ -58,14 +58,9 @@ async function main() {
5858
`</div>`
5959
);
6060

61-
62-
63-
// Update the followers count
64-
65-
6661
writeFileSync(READMEFILE_PATH, readme);
6762
}
6863

69-
main().then(async()=>{
70-
await updateWorkflowNumber()
71-
})
64+
main().then(async () => {
65+
await updateWorkflowNumber();
66+
});

0 commit comments

Comments
 (0)