mirror of
https://github.com/zebrajr/react.git
synced 2025-12-07 12:20:38 +01:00
Also update instructions to match recent script changes. Also add reproducible commit SHA to post download instructions to support publishing the Firefox DevTools extension.
56 lines
1.3 KiB
JavaScript
56 lines
1.3 KiB
JavaScript
#!/usr/bin/env node
|
|
|
|
'use strict';
|
|
|
|
const commandLineArgs = require('command-line-args');
|
|
const getBuildIdForCommit = require('../get-build-id-for-commit');
|
|
const theme = require('../theme');
|
|
|
|
const paramDefinitions = [
|
|
{
|
|
name: 'commit',
|
|
type: String,
|
|
description:
|
|
'GitHub commit SHA. When provided, automatically finds corresponding CI build.',
|
|
defaultValue: null,
|
|
},
|
|
{
|
|
name: 'skipTests',
|
|
type: Boolean,
|
|
description: 'Skip automated fixture tests.',
|
|
defaultValue: false,
|
|
},
|
|
{
|
|
name: 'releaseChannel',
|
|
alias: 'r',
|
|
type: String,
|
|
description: 'Release channel (stable or experimental)',
|
|
},
|
|
];
|
|
|
|
module.exports = async () => {
|
|
const params = commandLineArgs(paramDefinitions);
|
|
|
|
const channel = params.releaseChannel;
|
|
if (channel !== 'experimental' && channel !== 'stable') {
|
|
console.error(
|
|
theme.error`Invalid release channel (-r) "${channel}". Must be "stable" or "experimental".`
|
|
);
|
|
process.exit(1);
|
|
}
|
|
|
|
if (params.commit === null) {
|
|
console.error(theme.error`No --commit param specified.`);
|
|
process.exit(1);
|
|
}
|
|
|
|
try {
|
|
params.build = await getBuildIdForCommit(params.commit);
|
|
} catch (error) {
|
|
console.error(theme.error(error));
|
|
process.exit(1);
|
|
}
|
|
|
|
return params;
|
|
};
|