Skip to content

Commit

Permalink
Fix release script --commit param (facebook#20720)
Browse files Browse the repository at this point in the history
PR facebook#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.)
  • Loading branch information
acdlite authored and koto committed Jun 15, 2021
1 parent 23ded93 commit 27b13e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
7 changes: 1 addition & 6 deletions scripts/release/download-experimental-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, '..', '..');
Expand Down
8 changes: 2 additions & 6 deletions scripts/release/shared-commands/parse-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`.');
Expand Down

0 comments on commit 27b13e4

Please sign in to comment.