X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=scripts%2Fgenerate-code-contributors.ts;h=0d6266056780b6f593f4871a2083fbe372f95d98;hb=bfc6bb947d5e464c6038763baf7bf99388aa87f7;hp=0cce62180cb5c36420288228c39097679754408b;hpb=92d83c6a78e86c66a55958f8e36a7f2e123efdf8;p=github%2FChocobozzz%2FPeerTube.git diff --git a/scripts/generate-code-contributors.ts b/scripts/generate-code-contributors.ts index 0cce62180..0d6266056 100755 --- a/scripts/generate-code-contributors.ts +++ b/scripts/generate-code-contributors.ts @@ -1,5 +1,5 @@ import { doRequest } from '../server/helpers/requests' -import { readFileSync } from 'fs' +import { readFileSync } from 'fs-extra' run() .then(() => process.exit(0)) @@ -35,13 +35,17 @@ async function run () { { console.log('\n\n# Design\n') - console.log('By [Olivier Massain](https://twitter.com/omassain)\n') - console.log('Icons from [Robbie Pearce](https://robbiepearce.com/softies/)') + console.log(' * [Olivier Massain](https://twitter.com/omassain)') + + console.log('\n\n# Icons\n') + console.log(' * [Robbie Pearce](https://robbiepearce.com/softies/)') + console.log(' * [Fork-Awesome](https://github.com/ForkAwesome/Fork-Awesome)') + console.log(' * playlist add by Google') } } function get (url: string, headers: any = {}) { - return doRequest({ + return doRequest({ uri: url, json: true, headers: Object.assign(headers, { @@ -70,11 +74,17 @@ async function fetchGithub (url: string) { async function fetchZanata (zanataUsername: string, zanataPassword: string) { const today = new Date().toISOString().split('T')[0] - const url = `https://trad.framasoft.org/zanata/rest/project/peertube/version/develop/contributors/2018-01-01..${today}` + const year2018 = `https://trad.framasoft.org/zanata/rest/project/peertube/version/develop/contributors/2018-01-01..2019-01-01` + const year2019 = `https://trad.framasoft.org/zanata/rest/project/peertube/version/develop/contributors/2019-01-01..${today}` const headers = { 'X-Auth-User': zanataUsername, 'X-Auth-Token': zanataPassword } - return get(url, headers) + const [ results2018, results2019 ] = await Promise.all([ + get(year2018, headers), + get(year2019, headers) + ]) + + return results2018.concat(results2019) }