aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/generate-code-contributors.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-02-11 11:52:34 +0100
committerChocobozzz <me@florianbigard.com>2019-02-11 11:52:34 +0100
commit88108880bbdba473cfe36ecbebc1c3c4f972e102 (patch)
treeb242efb3b4f0d7e49d88f2d1f2063b5b3b0489c0 /scripts/generate-code-contributors.ts
parent53a94c7cfa8368da4cd248d65df8346905938f0c (diff)
parent9b712a2017e4ab3cf12cd6bd58278905520159d0 (diff)
downloadPeerTube-88108880bbdba473cfe36ecbebc1c3c4f972e102.tar.gz
PeerTube-88108880bbdba473cfe36ecbebc1c3c4f972e102.tar.zst
PeerTube-88108880bbdba473cfe36ecbebc1c3c4f972e102.zip
Merge branch 'develop' into pr/1217
Diffstat (limited to 'scripts/generate-code-contributors.ts')
-rwxr-xr-xscripts/generate-code-contributors.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/scripts/generate-code-contributors.ts b/scripts/generate-code-contributors.ts
index 3d37372d1..96110307a 100755
--- a/scripts/generate-code-contributors.ts
+++ b/scripts/generate-code-contributors.ts
@@ -41,7 +41,7 @@ async function run () {
41} 41}
42 42
43function get (url: string, headers: any = {}) { 43function get (url: string, headers: any = {}) {
44 return doRequest({ 44 return doRequest<any>({
45 uri: url, 45 uri: url,
46 json: true, 46 json: true,
47 headers: Object.assign(headers, { 47 headers: Object.assign(headers, {
@@ -70,11 +70,17 @@ async function fetchGithub (url: string) {
70 70
71async function fetchZanata (zanataUsername: string, zanataPassword: string) { 71async function fetchZanata (zanataUsername: string, zanataPassword: string) {
72 const today = new Date().toISOString().split('T')[0] 72 const today = new Date().toISOString().split('T')[0]
73 const url = `https://trad.framasoft.org/zanata/rest/project/peertube/version/develop/contributors/2018-01-01..${today}` 73 const year2018 = `https://trad.framasoft.org/zanata/rest/project/peertube/version/develop/contributors/2018-01-01..2019-01-01`
74 const year2019 = `https://trad.framasoft.org/zanata/rest/project/peertube/version/develop/contributors/2019-01-01..${today}`
74 75
75 const headers = { 76 const headers = {
76 'X-Auth-User': zanataUsername, 77 'X-Auth-User': zanataUsername,
77 'X-Auth-Token': zanataPassword 78 'X-Auth-Token': zanataPassword
78 } 79 }
79 return get(url, headers) 80 const [ results2018, results2019 ] = await Promise.all([
81 get(year2018, headers),
82 get(year2019, headers)
83 ])
84
85 return results2018.concat(results2019)
80} 86}