mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fix release script --commit param (#20720)
PR #20717 accidentally broke the `--commit` parameter because the script errors if you provide both a `--build` and a `--commit`. I solved by removing the validation error. When there's a conflict, it will choose the --`build`. (Although maybe we should `--build` entirely and always uses `--commit`. I think `--commit` is a sufficient replacement.)
This commit is contained in:
@@ -11,18 +11,13 @@ const {
|
||||
|
||||
const checkEnvironmentVariables = require('./shared-commands/check-environment-variables');
|
||||
const downloadBuildArtifacts = require('./shared-commands/download-build-artifacts');
|
||||
const getLatestMasterBuildNumber = require('./shared-commands/get-latest-master-build-number');
|
||||
const parseParams = require('./shared-commands/parse-params');
|
||||
const printSummary = require('./download-experimental-build-commands/print-summary');
|
||||
|
||||
const run = async () => {
|
||||
try {
|
||||
addDefaultParamValue('-r', '--releaseChannel', 'experimental');
|
||||
addDefaultParamValue(
|
||||
null,
|
||||
'--build',
|
||||
await getLatestMasterBuildNumber(true)
|
||||
);
|
||||
addDefaultParamValue(null, '--commit', 'master');
|
||||
|
||||
const params = await parseParams();
|
||||
params.cwd = join(__dirname, '..', '..');
|
||||
|
||||
@@ -38,12 +38,8 @@ module.exports = async () => {
|
||||
const params = commandLineArgs(paramDefinitions);
|
||||
|
||||
if (params.build !== null) {
|
||||
if (params.commit !== null) {
|
||||
console.error(
|
||||
'`build` and `commmit` params are mutually exclusive. Choose one or the other.`'
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
// TODO: Should we just remove the `build` param? Seems like `commit` is a
|
||||
// sufficient replacement.
|
||||
} else {
|
||||
if (params.commit === null) {
|
||||
console.error('Must provide either `build` or `commit`.');
|
||||
|
||||
Reference in New Issue
Block a user