4
4
5
5
const http = require ( 'request-promise-json' ) ;
6
6
const { exec} = require ( 'child-process-promise' ) ;
7
- const { readdirSync} = require ( 'fs' ) ;
8
7
const { readJsonSync} = require ( 'fs-extra' ) ;
9
8
const { logPromise} = require ( '../utils' ) ;
10
9
const theme = require ( '../theme' ) ;
@@ -23,8 +22,9 @@ const run = async ({cwd, tags}) => {
23
22
24
23
// If this release was created on Circle CI, grab the updated error codes from there.
25
24
// Else the user will have to manually regenerate them.
26
- if ( environment === "ci" ) {
25
+ if ( environment === 'ci' ) {
27
26
// https://circleci.com/docs/2.0/artifacts/#downloading-all-artifacts-for-a-build-on-circleci
27
+ // eslint-disable-next-line max-len
28
28
const metadataURL = `https://circleci.com/api/v1.1/project/github/facebook/react/${ buildNumber } /artifacts?circle-token=${
29
29
process . env . CIRCLE_CI_API_TOKEN
30
30
} `;
@@ -36,17 +36,16 @@ const run = async ({cwd, tags}) => {
36
36
entry => entry . path === 'home/circleci/project/node_modules.tgz'
37
37
) ;
38
38
const { url} = metadata . find (
39
- entry => entry . node_index === node_index && entry . path === 'home/circleci/project/scripts/error-codes/codes.json'
39
+ entry =>
40
+ entry . node_index === node_index &&
41
+ entry . path === 'home/circleci/project/scripts/error-codes/codes.json'
40
42
) ;
41
43
42
44
// Download and stage changers
43
45
await exec ( `curl ${ url } --output ${ cwd } /scripts/error-codes/codes.json` ) ;
44
46
}
45
47
} ;
46
48
47
- module . exports = async ( params ) => {
48
- return logPromise (
49
- run ( params ) ,
50
- theme `Retrieving error codes`
51
- ) ;
49
+ module . exports = async params => {
50
+ return logPromise ( run ( params ) , theme `Retrieving error codes` ) ;
52
51
} ;
0 commit comments