@samitouri / QOS-React-2 / commits / 0e526bcec2

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.)

Andrew Clark committed Feb 2, 2021 at 21:30 UTC 0e526bcec2a2940eb2cea6204efab76a2e4d7c0d
2 files changed +3 -12
scripts/release/download-experimental-build.js
+1 -6
@@ -11,18 +11,13 @@ const {
11
12 const checkEnvironmentVariables = require('./shared-commands/check-environment-variables');
13 const downloadBuildArtifacts = require('./shared-commands/download-build-artifacts');
14 -const getLatestMasterBuildNumber = require('./shared-commands/get-latest-master-build-number');
14 const parseParams = require('./shared-commands/parse-params');
15 const printSummary = require('./download-experimental-build-commands/print-summary');
16
17 const run = async () => {
18 try {
19 addDefaultParamValue('-r', '--releaseChannel', 'experimental');
21 - addDefaultParamValue(
22 - null,
23 - '--build',
24 - await getLatestMasterBuildNumber(true)
25 - );
20 + addDefaultParamValue(null, '--commit', 'master');
21
22 const params = await parseParams();
23 params.cwd = join(__dirname, '..', '..');
scripts/release/shared-commands/parse-params.js
+2 -6
@@ -38,12 +38,8 @@ module.exports = async () => {
38 const params = commandLineArgs(paramDefinitions);
39
40 if (params.build !== null) {
41 - if (params.commit !== null) {
42 - console.error(
43 - '`build` and `commmit` params are mutually exclusive. Choose one or the other.`'
44 - );
45 - process.exit(1);
46 - }
41 + // TODO: Should we just remove the `build` param? Seems like `commit` is a
42 + // sufficient replacement.
43 } else {
44 if (params.commit === null) {
45 console.error('Must provide either `build` or `commit`.');