From ab11054a16345afb48d94ba513f93911d3aa8a00 Mon Sep 17 00:00:00 2001 From: FonduemangVI Date: Sun, 31 Mar 2024 23:23:01 +1100 Subject: [PATCH] Updated --- .github/scripts/update-contributors.js | 81 +++++++++++++------------- 1 file changed, 40 insertions(+), 41 deletions(-) diff --git a/.github/scripts/update-contributors.js b/.github/scripts/update-contributors.js index cce8dd82e..8f775534e 100644 --- a/.github/scripts/update-contributors.js +++ b/.github/scripts/update-contributors.js @@ -1,42 +1,41 @@ - const axios = require('axios'); - const fs = require('fs'); - - // Indentation function - function indentString(string, indentation) { - return string.split('\n').map(line => indentation + line).join('\n'); - } - - axios.get('https://api.github.com/repos/FonduemangVI/Guides/contributors') - .then((response) => { - let contributors = '\n'; - - response.data.forEach((user, index) => { - if (index % 6 === 0) { - contributors += '\n'; - } - - const userHtml = ` - `; - - contributors += indentString(userHtml, ' '); - - if ((index + 1) % 6 === 0 || index === response.data.length - 1) { - contributors += '\n'; - } - }); - - contributors += '
- - ${user.login} -
- ${user.login} -
-
\n'; - contributors = indentString(contributors, ''); - - fs.writeFileSync('CONTRIBUTORS.md', `## Contributors\n\n\n${contributors}\n\n`); - }) - .catch((error) => { - console.error(`Could not fetch contributors: ${error}`); +const axios = require('axios'); +const fs = require('fs'); + +// Indentation function +function indentString(string, indentation) { + return string.split('\n').map(line => indentation + line).join('\n'); +} + +axios.get('https://api.github.com/repos/FonduemangVI/Guides/contributors') + .then((response) => { + let contributors = '\n'; + + response.data.forEach((user, index) => { + if (index % 6 === 0) { + contributors += ''; + } + + const userHtml = ` +`; + + contributors += indentString(userHtml, ' '); + + if ((index + 1) % 6 === 0 || index === response.data.length - 1) { + contributors += '\n\n'; + } }); - \ No newline at end of file + + contributors += '
+ + ${user.login} +
+ ${user.login} +
+
\n'; + contributors = indentString(contributors, ''); + + fs.writeFileSync('CONTRIBUTORS.md', `## Contributors\n\n\n${contributors}\n\n`); + }) + .catch((error) => { + console.error(`Could not fetch contributors: ${error}`); + });