From a77f1466aa8b4ef279f0cebdb0c6b7139105976d Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Thu, 16 Jul 2020 12:40:07 +0200 Subject: [PATCH] Revert "[core] Allow dist tag as argv in use-react-dist-tag" This reverts commit dcbf778b00cdebe2d94ff9ed4473c5db135f226e. --- scripts/use-react-dist-tag.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/use-react-dist-tag.js b/scripts/use-react-dist-tag.js index c073e2aa4e1dd4..c4bc6ea2d653c8 100644 --- a/scripts/use-react-dist-tag.js +++ b/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: @@ -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}'`); } @@ -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); });