Skip to content

Commit

Permalink
Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn committed Nov 19, 2018
1 parent 4bb3548 commit 8ba1f03
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
15 changes: 7 additions & 8 deletions scripts/release/publish-commands/download-error-codes-from-ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

const http = require('request-promise-json');
const {exec} = require('child-process-promise');
const {readdirSync} = require('fs');
const {readJsonSync} = require('fs-extra');
const {logPromise} = require('../utils');
const theme = require('../theme');
Expand All @@ -23,8 +22,9 @@ const run = async ({cwd, tags}) => {

// If this release was created on Circle CI, grab the updated error codes from there.
// Else the user will have to manually regenerate them.
if (environment === "ci") {
if (environment === 'ci') {
// https://circleci.com/docs/2.0/artifacts/#downloading-all-artifacts-for-a-build-on-circleci
// eslint-disable-next-line max-len
const metadataURL = `https://circleci.com/api/v1.1/project/github/facebook/react/${buildNumber}/artifacts?circle-token=${
process.env.CIRCLE_CI_API_TOKEN
}`;
Expand All @@ -36,17 +36,16 @@ const run = async ({cwd, tags}) => {
entry => entry.path === 'home/circleci/project/node_modules.tgz'
);
const {url} = metadata.find(
entry => entry.node_index === node_index && entry.path === 'home/circleci/project/scripts/error-codes/codes.json'
entry =>
entry.node_index === node_index &&
entry.path === 'home/circleci/project/scripts/error-codes/codes.json'
);

// Download and stage changers
await exec(`curl ${url} --output ${cwd}/scripts/error-codes/codes.json`);
}
};

module.exports = async (params) => {
return logPromise(
run(params),
theme`Retrieving error codes`
);
module.exports = async params => {
return logPromise(run(params), theme`Retrieving error codes`);
};
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,15 @@ const run = async ({cwd, packages, tags}) => {
);
console.log(theme.command` git push origin --tags`);


if (tags.includes('latest')) {
console.log();
console.log(
theme`{header Don't forget to commit the generated }{path scripts/error-codes/codes.json}`
);
if (environment === "ci") {
console.log(`This file has been updated locally. Please review it before committing.`);
if (environment === 'ci') {
console.log(
`This file has been updated locally. Please review it before committing.`
);
} else {
console.log(
`The release that was just published was created locally. ` +
Expand Down

0 comments on commit 8ba1f03

Please sign in to comment.