Skip to content

Commit 2badcfd

Browse files
committed
xor the IS_* platform options
1 parent fd6396d commit 2badcfd

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

packages/compass-e2e-tests/smoke-test.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,7 @@ const argv = yargs(hideBin(process.argv))
4848
type: 'string',
4949
choices: ['x64', 'arm64'],
5050
demandOption: true,
51-
default: () => {
52-
if (process.env.ARCH) {
53-
return process.env.ARCH;
54-
}
55-
return process.arch;
56-
},
51+
default: () => process.env.ARCH ?? process.arch,
5752
})
5853
.option('skipDownload', {
5954
type: 'boolean',
@@ -73,9 +68,16 @@ const argv = yargs(hideBin(process.argv))
7368
}
7469
}
7570

76-
if (!(argv.isWindows || argv.isOSX || argv.isUbuntu || argv.isRHEL)) {
71+
// hadron-build info can only do one platform & arch at a time
72+
const platformsCount = [
73+
argv.isWindows,
74+
argv.isOSX,
75+
argv.isUbuntu,
76+
argv.isRHEL,
77+
].filter((x) => x).length;
78+
if (platformsCount !== 1) {
7779
throw new Error(
78-
'Set at least one of IS_WINDOWS, IS_OSX, IS_UBUNTU, IS_RHEL'
80+
'Set exactly one of IS_WINDOWS, IS_OSX, IS_UBUNTU, IS_RHEL to true'
7981
);
8082
}
8183

0 commit comments

Comments
 (0)