Skip to content

Commit a121dd8

Browse files
per1234kittaakos
andauthored
Update scripts/merge-channel-files.js
Co-authored-by: Akos Kitta <[email protected]>
1 parent f076580 commit a121dd8

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

Diff for: scripts/merge-channel-files.js

+12-10
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,26 @@ Flags:
2121
}
2222

2323
const channelFlagIndex = process.argv.indexOf('--channel');
24-
25-
let channel;
26-
if (channelFlagIndex > -1) {
27-
channel = process.argv[channelFlagIndex + 1];
28-
} else {
24+
if (channelFlagIndex < 0) {
2925
console.error('Missing required --channel flag');
3026
process.exit(1);
3127
}
28+
const channel = process.argv[channelFlagIndex + 1];
29+
if (!channel) {
30+
console.error('--channel value must be set');
31+
process.exit(1);
32+
}
3233

3334
const inputFlagIndex = process.argv.indexOf('--input');
34-
35-
let channelFilesFolder;
36-
if (inputFlagIndex > -1) {
37-
channelFilesFolder = process.argv[inputFlagIndex + 1];
38-
} else {
35+
if (inputFlagIndex < 0) {
3936
console.error('Missing required --input flag');
4037
process.exit(1);
4138
}
39+
const channelFilesFolder = process.argv[inputFlagIndex + 1];
40+
if (!channelFilesFolder) {
41+
console.error('--input value must be set');
42+
process.exit(1);
43+
}
4244

4345
// Staging file filename suffixes are named according to `runner.arch`.
4446
// https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context

0 commit comments

Comments
 (0)