Skip to content

Commit

Permalink
Revert "[core] Allow dist tag as argv in use-react-dist-tag"
Browse files Browse the repository at this point in the history
This reverts commit dcbf778.
  • Loading branch information
eps1lon committed Jul 16, 2020
1 parent dcbf778 commit a77f146
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions scripts/use-react-dist-tag.js
@@ -1,6 +1,6 @@
/* eslint-disable no-console */
/**
* Given the dist tag fetch the corresponding
* Given an environment variable called `REACT_DIST_TAG` fetch the corresponding
* version and make sure this version is used throughout the repository.
*
* If you work on this file:
Expand All @@ -18,8 +18,7 @@ const exec = promisify(childProcess.exec);
// packages published from the react monorepo using the same version
const reactPackageNames = ['react', 'react-dom', 'react-is', 'react-test-renderer', 'scheduler'];

async function main(options) {
const { distTag } = options;
async function main(distTag) {
if (typeof distTag !== 'string') {
throw new TypeError(`expected distTag: string but got '${distTag}'`);
}
Expand Down Expand Up @@ -55,8 +54,7 @@ async function main(options) {
await exec(`git apply ${path.resolve(__dirname, `./react-${distTag}.diff`)}`);
}

const [distTag = process.env.REACT_DIST_TAG] = process.argv.slice(2);
main({ distTag }).catch((error) => {
main(process.env.REACT_DIST_TAG).catch((error) => {
console.error(error);
process.exit(1);
});

0 comments on commit a77f146

Please sign in to comment.