Skip to content

Commit c47f3cf

Browse files
author
Brian Vaughn
authored
Restore experimental build script's ability to auto download latest build (#20717)
1 parent 3e0bdbe commit c47f3cf

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

scripts/release/download-experimental-build.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@ const printSummary = require('./download-experimental-build-commands/print-summa
1818
const run = async () => {
1919
try {
2020
addDefaultParamValue('-r', '--releaseChannel', 'experimental');
21+
addDefaultParamValue(
22+
null,
23+
'--build',
24+
await getLatestMasterBuildNumber(true)
25+
);
2126

2227
const params = await parseParams();
2328
params.cwd = join(__dirname, '..', '..');
2429
params.packages = await getPublicPackages(true);
2530

26-
if (!params.build) {
27-
params.build = await getLatestMasterBuildNumber(true);
28-
}
29-
3031
await checkEnvironmentVariables(params);
3132
await downloadBuildArtifacts(params);
3233

scripts/release/utils.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ const logger = createLogger({
1717
storagePath: join(__dirname, '.progress-estimator'),
1818
});
1919

20-
const addDefaultParamValue = (shortName, longName, defaultValue) => {
20+
const addDefaultParamValue = (optionalShortName, longName, defaultValue) => {
2121
let found = false;
2222
for (let i = 0; i < process.argv.length; i++) {
2323
const current = process.argv[i];
24-
if (current === shortName || current.startsWith(`${longName}=`)) {
24+
if (current === optionalShortName || current.startsWith(`${longName}=`)) {
2525
found = true;
2626
break;
2727
}
2828
}
2929

3030
if (!found) {
31-
process.argv.push(shortName, defaultValue);
31+
process.argv.push(`${longName}=${defaultValue}`);
3232
}
3333
};
3434

0 commit comments

Comments
 (0)