aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-07-30 14:54:31 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-07-31 11:32:04 +0200
commitf0af38e69677d1afe17e48b3f5267128db3db1a4 (patch)
tree98dd8c4ac07e7d77e0c46407e50a5b0f6aaecc43 /scripts
parent7abb5c5da1ed7c6945e81b9e3da0a14f623f69ea (diff)
downloadPeerTube-f0af38e69677d1afe17e48b3f5267128db3db1a4.tar.gz
PeerTube-f0af38e69677d1afe17e48b3f5267128db3db1a4.tar.zst
PeerTube-f0af38e69677d1afe17e48b3f5267128db3db1a4.zip
Fix lint
Diffstat (limited to 'scripts')
-rw-r--r--scripts/danger/clean/cleaner.ts6
-rwxr-xr-xscripts/generate-code-contributors.ts240
-rwxr-xr-xscripts/i18n/create-custom-files.ts8
-rwxr-xr-xscripts/parse-log.ts4
-rwxr-xr-xscripts/prune-storage.ts3
-rwxr-xr-xscripts/reset-password.ts4
6 files changed, 135 insertions, 130 deletions
diff --git a/scripts/danger/clean/cleaner.ts b/scripts/danger/clean/cleaner.ts
index 2d5366a91..69e8a63a0 100644
--- a/scripts/danger/clean/cleaner.ts
+++ b/scripts/danger/clean/cleaner.ts
@@ -14,7 +14,7 @@ initDatabaseModels(true)
14 console.info('Tables of %s deleted.', CONFIG.DATABASE.DBNAME) 14 console.info('Tables of %s deleted.', CONFIG.DATABASE.DBNAME)
15 15
16 const STORAGE = CONFIG.STORAGE 16 const STORAGE = CONFIG.STORAGE
17 Promise.mapSeries(Object.keys(STORAGE), storage => { 17 return Promise.mapSeries(Object.keys(STORAGE), storage => {
18 const storageDir = STORAGE[storage] 18 const storageDir = STORAGE[storage]
19 19
20 return new Promise((res, rej) => { 20 return new Promise((res, rej) => {
@@ -28,3 +28,7 @@ initDatabaseModels(true)
28 }) 28 })
29 .then(() => process.exit(0)) 29 .then(() => process.exit(0))
30 }) 30 })
31 .catch(err => {
32 console.error(err)
33 process.exit(-1)
34 })
diff --git a/scripts/generate-code-contributors.ts b/scripts/generate-code-contributors.ts
index 53813e6ab..2f76d78c2 100755
--- a/scripts/generate-code-contributors.ts
+++ b/scripts/generate-code-contributors.ts
@@ -1,10 +1,6 @@
1import { registerTSPaths } from '../server/helpers/register-ts-paths' 1import { registerTSPaths } from '../server/helpers/register-ts-paths'
2
3registerTSPaths() 2registerTSPaths()
4 3
5import { doRequest } from '../server/helpers/requests'
6import { readFileSync } from 'fs-extra'
7import { uniqBy } from 'lodash'
8import { execCLI } from '@shared/extra-utils' 4import { execCLI } from '@shared/extra-utils'
9 5
10run() 6run()
@@ -50,124 +46,124 @@ async function getGitContributors () {
50 46
51// Zanata is dead, don't loose the contributors name 47// Zanata is dead, don't loose the contributors name
52function getZanataContributors () { 48function getZanataContributors () {
53 return [ { 'username': 'abdhessuk', 'name': 'Abd Hessuk' }, { 'username': 'abidin24', 'name': 'abidin toumi' }, { 49 return [ { username: 'abdhessuk', name: 'Abd Hessuk' }, { username: 'abidin24', name: 'abidin toumi' }, {
54 'username': 'aditoo', 50 username: 'aditoo',
55 'name': 'Lorem Ipsum' 51 name: 'Lorem Ipsum'
56 }, { 'username': 'alice', 'name': 'Alice' }, { 'username': 'anastasia', 'name': 'Anastasia' }, { 52 }, { username: 'alice', name: 'Alice' }, { username: 'anastasia', name: 'Anastasia' }, {
57 'username': 'autom', 53 username: 'autom',
58 'name': 'Filip Bengtsson' 54 name: 'Filip Bengtsson'
59 }, { 'username': 'balaji', 'name': 'Balaji' }, { 'username': 'bristow', 'name': 'Cédric F.' }, { 55 }, { username: 'balaji', name: 'Balaji' }, { username: 'bristow', name: 'Cédric F.' }, {
60 'username': 'butterflyoffire', 56 username: 'butterflyoffire',
61 'name': 'ButterflyOfFire' 57 name: 'ButterflyOfFire'
62 }, { 'username': 'chocobozzz', 'name': 'Chocobozzz' }, { 'username': 'claichou', 'name': 'Claire Mohin' }, { 58 }, { username: 'chocobozzz', name: 'Chocobozzz' }, { username: 'claichou', name: 'Claire Mohin' }, {
63 'username': 'degrange', 59 username: 'degrange',
64 'name': 'Degrange Mathieu' 60 name: 'Degrange Mathieu'
65 }, { 'username': 'dibek', 'name': 'Giuseppe Di Bella' }, { 'username': 'edu', 'name': 'eduardo' }, { 61 }, { username: 'dibek', name: 'Giuseppe Di Bella' }, { username: 'edu', name: 'eduardo' }, {
66 'username': 'ehsaan', 62 username: 'ehsaan',
67 'name': 'ehsaan' 63 name: 'ehsaan'
68 }, { 'username': 'esoforte', 'name': 'Ondřej Kotas' }, { 'username': 'fkohrt', 'name': 'Florian Kohrt' }, { 64 }, { username: 'esoforte', name: 'Ondřej Kotas' }, { username: 'fkohrt', name: 'Florian Kohrt' }, {
69 'username': 'giqtaqisi', 65 username: 'giqtaqisi',
70 'name': 'Ian Townsend' 66 name: 'Ian Townsend'
71 }, { 'username': 'goofy', 'name': 'goofy' }, { 'username': 'gorkaazk', 'name': 'Gorka Azkarate Zubiaur' }, { 67 }, { username: 'goofy', name: 'goofy' }, { username: 'gorkaazk', name: 'Gorka Azkarate Zubiaur' }, {
72 'username': 'gwendald', 68 username: 'gwendald',
73 'name': 'GwendalD' 69 name: 'GwendalD'
74 }, { 'username': 'h3zjp', 'name': 'h3zjp' }, { 'username': 'jfblanc', 'name': 'Joan Francés Blanc' }, { 70 }, { username: 'h3zjp', name: 'h3zjp' }, { username: 'jfblanc', name: 'Joan Francés Blanc' }, {
75 'username': 'jhertel', 71 username: 'jhertel',
76 'name': 'Jean Hertel' 72 name: 'Jean Hertel'
77 }, { 'username': 'jmf', 'name': 'Jan-Michael Franz' }, { 'username': 'jorropo', 'name': 'Jorropo' }, { 73 }, { username: 'jmf', name: 'Jan-Michael Franz' }, { username: 'jorropo', name: 'Jorropo' }, {
78 'username': 'kairozen', 74 username: 'kairozen',
79 'name': 'Geoffrey Baudelet' 75 name: 'Geoffrey Baudelet'
80 }, { 'username': 'kedemferre', 'name': 'Kédem Ferré' }, { 'username': 'kousha', 'name': 'Kousha Zanjani' }, { 76 }, { username: 'kedemferre', name: 'Kédem Ferré' }, { username: 'kousha', name: 'Kousha Zanjani' }, {
81 'username': 'krkk', 77 username: 'krkk',
82 'name': 'Karol Kosek' 78 name: 'Karol Kosek'
83 }, { 'username': 'landrok', 'name': 'Landrok' }, { 'username': 'leeroyepold48', 'name': 'Leeroy Epold' }, { 79 }, { username: 'landrok', name: 'Landrok' }, { username: 'leeroyepold48', name: 'Leeroy Epold' }, {
84 'username': 'm4sk1n', 80 username: 'm4sk1n',
85 'name': 'marcin mikołajczak' 81 name: 'marcin mikołajczak'
86 }, { 'username': 'matograine', 'name': 'tom ngr' }, { 'username': 'medow', 'name': 'Mahir Ahmed' }, { 82 }, { username: 'matograine', name: 'tom ngr' }, { username: 'medow', name: 'Mahir Ahmed' }, {
87 'username': 'mhu', 83 username: 'mhu',
88 'name': 'Max Hübner' 84 name: 'Max Hübner'
89 }, { 'username': 'midgard', 'name': 'Midgard' }, { 'username': 'nbrucy', 'name': 'N. B.' }, { 85 }, { username: 'midgard', name: 'Midgard' }, { username: 'nbrucy', name: 'N. B.' }, {
90 'username': 'nitai', 86 username: 'nitai',
91 'name': 'nitai bezerra' 87 name: 'nitai bezerra'
92 }, { 'username': 'noncommutativegeo', 'name': 'Andrea Panontin' }, { 'username': 'nopsidy', 'name': 'McFlat' }, { 88 }, { username: 'noncommutativegeo', name: 'Andrea Panontin' }, { username: 'nopsidy', name: 'McFlat' }, {
93 'username': 'nvivant', 89 username: 'nvivant',
94 'name': 'Nicolas Vivant' 90 name: 'Nicolas Vivant'
95 }, { 'username': 'osoitz', 'name': 'Osoitz' }, { 'username': 'outloudvi', 'name': 'Outvi V' }, { 91 }, { username: 'osoitz', name: 'Osoitz' }, { username: 'outloudvi', name: 'Outvi V' }, {
96 'username': 'quentin', 92 username: 'quentin',
97 'name': 'Quentí' 93 name: 'Quentí'
98 }, { 'username': 'quentind', 'name': 'Quentin Dupont' }, { 'username': 'rafaelff', 'name': 'Rafael Fontenelle' }, { 94 }, { username: 'quentind', name: 'Quentin Dupont' }, { username: 'rafaelff', name: 'Rafael Fontenelle' }, {
99 'username': 'rigelk', 95 username: 'rigelk',
100 'name': 'Rigel Kent' 96 name: 'Rigel Kent'
101 }, { 'username': 's8321414', 'name': 'Jeff Huang' }, { 'username': 'sato_ss', 'name': 'Satoshi Shirosaka' }, { 97 }, { username: 's8321414', name: 'Jeff Huang' }, { username: 'sato_ss', name: 'Satoshi Shirosaka' }, {
102 'username': 'sercom_kc', 98 username: 'sercom_kc',
103 'name': 'SerCom_KC' 99 name: 'SerCom_KC'
104 }, { 'username': 'severo', 'name': 'Sylvain Lesage' }, { 'username': 'silkevicious', 'name': 'Sylke Vicious' }, { 100 }, { username: 'severo', name: 'Sylvain Lesage' }, { username: 'silkevicious', name: 'Sylke Vicious' }, {
105 'username': 'sosha', 101 username: 'sosha',
106 'name': 'Sosha' 102 name: 'Sosha'
107 }, { 'username': 'spla', 'name': 'spla' }, { 'username': 'strubbl', 'name': 'Sven' }, { 103 }, { username: 'spla', name: 'spla' }, { username: 'strubbl', name: 'Sven' }, {
108 'username': 'swedneck', 104 username: 'swedneck',
109 'name': 'Tim Stahel' 105 name: 'Tim Stahel'
110 }, { 'username': 'tagomago', 'name': 'Tagomago' }, { 'username': 'talone', 'name': 'TitiAlone' }, { 106 }, { username: 'tagomago', name: 'Tagomago' }, { username: 'talone', name: 'TitiAlone' }, {
111 'username': 'thibaultmartin', 107 username: 'thibaultmartin',
112 'name': 'Thibault Martin' 108 name: 'Thibault Martin'
113 }, { 'username': 'tirifto', 'name': 'Tirifto' }, { 'username': 'tuxayo', 'name': 'Victor Grousset/tuxayo' }, { 109 }, { username: 'tirifto', name: 'Tirifto' }, { username: 'tuxayo', name: 'Victor Grousset/tuxayo' }, {
114 'username': 'unextro', 110 username: 'unextro',
115 'name': 'Ondřej Pokorný' 111 name: 'Ondřej Pokorný'
116 }, { 'username': 'unzarida', 'name': 'unzarida' }, { 'username': 'vincent', 'name': 'Vincent Laporte' }, { 112 }, { username: 'unzarida', name: 'unzarida' }, { username: 'vincent', name: 'Vincent Laporte' }, {
117 'username': 'wanhua', 113 username: 'wanhua',
118 'name': 'wanhua' 114 name: 'wanhua'
119 }, { 'username': 'xinayder', 'name': 'Alexandre' }, { 'username': 'xosem', 'name': 'Xosé M.' }, { 115 }, { username: 'xinayder', name: 'Alexandre' }, { username: 'xosem', name: 'Xosé M.' }, {
120 'username': 'zveryok', 116 username: 'zveryok',
121 'name': 'Nikitin Stanislav' 117 name: 'Nikitin Stanislav'
122 }, { 'username': '6543', 'name': '6543' }, { 'username': 'aasami', 'name': 'Miroslav Ďurian' }, { 118 }, { username: '6543', name: '6543' }, { username: 'aasami', name: 'Miroslav Ďurian' }, {
123 'username': 'alidemirtas', 119 username: 'alidemirtas',
124 'name': 'Ali Demirtas' 120 name: 'Ali Demirtas'
125 }, { 'username': 'alpha', 'name': 'Alpha' }, { 'username': 'ariasuni', 'name': 'Mélanie Chauvel' }, { 121 }, { username: 'alpha', name: 'Alpha' }, { username: 'ariasuni', name: 'Mélanie Chauvel' }, {
126 'username': 'bfonton', 122 username: 'bfonton',
127 'name': 'Baptiste Fonton' 123 name: 'Baptiste Fonton'
128 }, { 'username': 'c0dr', 'name': 'c0dr lnx' }, { 'username': 'canony', 'name': 'canony' }, { 124 }, { username: 'c0dr', name: 'c0dr lnx' }, { username: 'canony', name: 'canony' }, {
129 'username': 'cat', 125 username: 'cat',
130 'name': 'Cat' 126 name: 'Cat'
131 }, { 'username': 'clerie', 'name': 'Clemens Riese' }, { 'username': 'curupira', 'name': 'Curupira' }, { 127 }, { username: 'clerie', name: 'Clemens Riese' }, { username: 'curupira', name: 'Curupira' }, {
132 'username': 'dhsets', 128 username: 'dhsets',
133 'name': 'djsets' 129 name: 'djsets'
134 }, { 'username': 'digitalkiller', 'name': 'Digital Killer' }, { 'username': 'dwsage', 'name': 'd.w. sage' }, { 130 }, { username: 'digitalkiller', name: 'Digital Killer' }, { username: 'dwsage', name: 'd.w. sage' }, {
135 'username': 'flauta', 131 username: 'flauta',
136 'name': 'Andrea Primiani' 132 name: 'Andrea Primiani'
137 }, { 'username': 'frankstrater', 'name': 'Frank Sträter' }, { 'username': 'gillux', 'name': 'gillux' }, { 133 }, { username: 'frankstrater', name: 'Frank Sträter' }, { username: 'gillux', name: 'gillux' }, {
138 'username': 'gunchleoc', 134 username: 'gunchleoc',
139 'name': 'GunChleoc' 135 name: 'GunChleoc'
140 }, { 'username': 'jaidedtd', 'name': 'Jenga Phoenix' }, { 'username': 'joss2lyon', 'name': 'Josselin' }, { 136 }, { username: 'jaidedtd', name: 'Jenga Phoenix' }, { username: 'joss2lyon', name: 'Josselin' }, {
141 'username': 'kekkotranslates', 137 username: 'kekkotranslates',
142 'name': 'Francesco' 138 name: 'Francesco'
143 }, { 'username': 'kingu', 'name': 'Allan Nordhøy' }, { 'username': 'kittybecca', 'name': 'Rivka bat Tsvi' }, { 139 }, { username: 'kingu', name: 'Allan Nordhøy' }, { username: 'kittybecca', name: 'Rivka bat Tsvi' }, {
144 'username': 'knuxify', 140 username: 'knuxify',
145 'name': 'knuxify' 141 name: 'knuxify'
146 }, { 'username': 'lapor', 'name': 'Kristijan Tkalec' }, { 'username': 'laufor', 'name': 'Lau For' }, { 142 }, { username: 'lapor', name: 'Kristijan Tkalec' }, { username: 'laufor', name: 'Lau For' }, {
147 'username': 'lstamellos', 143 username: 'lstamellos',
148 'name': 'Loukas Stamellos' 144 name: 'Loukas Stamellos'
149 }, { 'username': 'lw1', 'name': 'Lukas Winkler' }, { 'username': 'mablr', 'name': 'Mablr' }, { 145 }, { username: 'lw1', name: 'Lukas Winkler' }, { username: 'mablr', name: 'Mablr' }, {
150 'username': 'marcinmalecki', 146 username: 'marcinmalecki',
151 'name': 'Marcin Małecki' 147 name: 'Marcin Małecki'
152 }, { 'username': 'mayana', 'name': 'Mayana' }, { 'username': 'mikeorlov', 'name': 'Michael Orlov' }, { 148 }, { username: 'mayana', name: 'Mayana' }, { username: 'mikeorlov', name: 'Michael Orlov' }, {
153 'username': 'nin', 149 username: 'nin',
154 'name': 'nz' 150 name: 'nz'
155 }, { 'username': 'norbipeti', 'name': 'NorbiPeti' }, { 'username': 'ppnplus', 'name': 'Phongpanot Phairat' }, { 151 }, { username: 'norbipeti', name: 'NorbiPeti' }, { username: 'ppnplus', name: 'Phongpanot Phairat' }, {
156 'username': 'predatorix', 152 username: 'predatorix',
157 'name': 'Predatorix' 153 name: 'Predatorix'
158 }, { 'username': 'robin', 'name': 'Robin Lahtinen' }, { 'username': 'rond', 'name': 'rondnelly nunes' }, { 154 }, { username: 'robin', name: 'Robin Lahtinen' }, { username: 'rond', name: 'rondnelly nunes' }, {
159 'username': 'secreet', 155 username: 'secreet',
160 'name': 'Secreet' 156 name: 'Secreet'
161 }, { 'username': 'sftblw', 'name': 'sftblw' }, { 'username': 'sporiff', 'name': 'Ciarán Ainsworth' }, { 157 }, { username: 'sftblw', name: 'sftblw' }, { username: 'sporiff', name: 'Ciarán Ainsworth' }, {
162 'username': 'tekuteku', 158 username: 'tekuteku',
163 'name': 'tekuteku' 159 name: 'tekuteku'
164 }, { 'username': 'thecatjustmeow', 'name': 'Nguyen Huynh Hung' }, { 'username': 'tmota', 'name': 'Tiago Mota' }, { 160 }, { username: 'thecatjustmeow', name: 'Nguyen Huynh Hung' }, { username: 'tmota', name: 'Tiago Mota' }, {
165 'username': 'uranix', 161 username: 'uranix',
166 'name': 'Michal Mauser' 162 name: 'Michal Mauser'
167 }, { 'username': 'wakutiteo', 'name': 'Markel' }, { 163 }, { username: 'wakutiteo', name: 'Markel' }, {
168 'username': 'wonderingdane', 164 username: 'wonderingdane',
169 'name': 'Nicolai Ireneo-Larsen' 165 name: 'Nicolai Ireneo-Larsen'
170 }, { 'username': 'zeynepeliacik', 'name': 'Zeynep Can' } ] 166 }, { username: 'zeynepeliacik', name: 'Zeynep Can' } ]
171} 167}
172 168
173function getContributorsBlacklist () { 169function getContributorsBlacklist () {
diff --git a/scripts/i18n/create-custom-files.ts b/scripts/i18n/create-custom-files.ts
index d39a15974..2862b230e 100755
--- a/scripts/i18n/create-custom-files.ts
+++ b/scripts/i18n/create-custom-files.ts
@@ -50,18 +50,18 @@ values(VIDEO_CATEGORIES)
50 'Sorry', 50 'Sorry',
51 'This video is not available because the remote instance is not responding.' 51 'This video is not available because the remote instance is not responding.'
52 ]) 52 ])
53 .forEach(v => serverKeys[v] = v) 53 .forEach(v => { serverKeys[v] = v })
54 54
55// More keys 55// More keys
56Object.assign(serverKeys, { 56Object.assign(serverKeys, {
57 'Misc': 'Misc', 57 Misc: 'Misc',
58 'Unknown': 'Unknown' 58 Unknown: 'Unknown'
59}) 59})
60 60
61// ISO 639 keys 61// ISO 639 keys
62const languageKeys: any = {} 62const languageKeys: any = {}
63const languages = buildLanguages() 63const languages = buildLanguages()
64Object.keys(languages).forEach(k => languageKeys[languages[k]] = languages[k]) 64Object.keys(languages).forEach(k => { languageKeys[languages[k]] = languages[k] })
65 65
66Object.assign(serverKeys, languageKeys) 66Object.assign(serverKeys, languageKeys)
67 67
diff --git a/scripts/parse-log.ts b/scripts/parse-log.ts
index 26049b54d..58e052b9f 100755
--- a/scripts/parse-log.ts
+++ b/scripts/parse-log.ts
@@ -79,7 +79,7 @@ function run () {
79 // Don't know why but loggerFormat does not remove splat key 79 // Don't know why but loggerFormat does not remove splat key
80 Object.assign(log, { splat: undefined }) 80 Object.assign(log, { splat: undefined })
81 81
82 logLevels[ log.level ](log) 82 logLevels[log.level](log)
83 }) 83 })
84 84
85 stream.once('close', () => res()) 85 stream.once('close', () => res())
@@ -90,7 +90,7 @@ function run () {
90async function getNewestFile (files: string[], basePath: string) { 90async function getNewestFile (files: string[], basePath: string) {
91 const sorted = await mtimeSortFilesDesc(files, basePath) 91 const sorted = await mtimeSortFilesDesc(files, basePath)
92 92
93 return (sorted.length > 0) ? sorted[ 0 ].file : '' 93 return (sorted.length > 0) ? sorted[0].file : ''
94} 94}
95 95
96function toTimeFormat (time: string) { 96function toTimeFormat (time: string) {
diff --git a/scripts/prune-storage.ts b/scripts/prune-storage.ts
index 2b04e906d..1def1d792 100755
--- a/scripts/prune-storage.ts
+++ b/scripts/prune-storage.ts
@@ -161,7 +161,8 @@ async function askConfirmation () {
161 } 161 }
162 prompt.get(schema, function (err, result) { 162 prompt.get(schema, function (err, result) {
163 if (err) return rej(err) 163 if (err) return rej(err)
164 return res(result.confirm && result.confirm.match(/y/) !== null) 164
165 return res(result.confirm?.match(/y/) !== null)
165 }) 166 })
166 }) 167 })
167} 168}
diff --git a/scripts/reset-password.ts b/scripts/reset-password.ts
index 863537500..bf6535cea 100755
--- a/scripts/reset-password.ts
+++ b/scripts/reset-password.ts
@@ -53,3 +53,7 @@ initDatabaseModels(true)
53 .finally(() => process.exit(0)) 53 .finally(() => process.exit(0))
54 }) 54 })
55 }) 55 })
56 .catch(err => {
57 console.error(err)
58 process.exit(-1)
59 })