Skip to content

Commit 6ea9ed6

Browse files
committed
Move validation to parse-params module
1 parent 52d1457 commit 6ea9ed6

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

scripts/release/prepare-release-from-ci.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ const run = async () => {
1818
const params = parseParams();
1919
params.cwd = join(__dirname, '..', '..');
2020

21-
const channel = params.releaseChannel;
22-
if (channel !== 'experimental' && channel !== 'stable') {
23-
console.error(
24-
`Invalid release channel: "${channel}". Must be "stable" or "experimental".`
25-
);
26-
process.exit(1);
27-
}
28-
2921
if (!params.build) {
3022
params.build = await getLatestMasterBuildNumber(false);
3123
}

scripts/release/shared-commands/parse-params.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,13 @@ const paramDefinitions = [
2828
module.exports = () => {
2929
const params = commandLineArgs(paramDefinitions);
3030

31+
const channel = params.releaseChannel;
32+
if (channel !== 'experimental' && channel !== 'stable') {
33+
console.error(
34+
`Invalid release channel (-r) "${channel}". Must be "stable" or "experimental".`
35+
);
36+
process.exit(1);
37+
}
38+
3139
return params;
3240
};

0 commit comments

Comments
 (0)