Use an explicit list of supported platforms for nicer error messages

This commit is contained in:
Benoit Daloze
2022-05-15 12:21:30 +02:00
parent e92b7971f0
commit 296bf7f67a
5 changed files with 37 additions and 2 deletions
+4
View File
@@ -13,6 +13,10 @@ const releasesURL = 'https://github.com/ruby/ruby-builder/releases'
const windows = common.windows
export function getAvailableVersions(platform, engine) {
if (!common.supportedPlatforms.includes(platform)) {
throw new Error(`Unsupported platform ${platform}`)
}
return rubyBuilderVersions[engine]
}