@@ -78,28 +78,28 @@ export async function getLLVMAssetURL(platform: string, arch: string, version: s
7878}
7979
8080async function getAssetKeywords ( platform : string , arch : string ) {
81- const keywords : string [ ] = [ ]
82- const optionalKeywords : string [ ] = [ ]
81+ const keywords : ( string | string [ ] ) [ ] = [ ]
82+ const optionalKeywords : ( string | string [ ] ) [ ] = [ ]
8383
8484 switch ( platform ) {
8585 case "win32" : {
86- optionalKeywords . push ( "windows" , "Windows" )
86+ const osKeywordsChoice : string [ ] = [ "windows" , "Windows" ]
8787 if ( x86_64 . includes ( arch ) ) {
88- // prefer win64 keyword over x86_64 or x64
89- optionalKeywords . push ( "win64" , "win64" , "win64" , "x86_64" , "X64" )
88+ osKeywordsChoice . push ( "win64" , "win64" , "win64" , "x86_64" , "X64" )
9089 // TODO fallback to win32 if win64 is not available (e.g. for LLVM 3.6.2 and older)
9190 } else if ( x86 . includes ( arch ) ) {
92- keywords . push ( "win32" )
91+ osKeywordsChoice . push ( "win32" )
9392 } else if ( arm64 . includes ( arch ) ) {
94- keywords . push ( "woa64" )
93+ osKeywordsChoice . push ( "woa64" )
9594 } else {
9695 info ( `Using arch ${ arch } for LLVM` )
97- keywords . push ( arch )
96+ osKeywordsChoice . push ( arch )
9897 }
98+ keywords . push ( osKeywordsChoice )
9999 break
100100 }
101101 case "linux" : {
102- optionalKeywords . push ( "linux" , "Linux" )
102+ const osKeywordsChoice = [ "linux" , "Linux" ]
103103
104104 if ( isUbuntu ( ) ) {
105105 optionalKeywords . push ( "ubuntu" )
@@ -117,7 +117,7 @@ async function getAssetKeywords(platform: string, arch: string) {
117117 }
118118
119119 if ( x86_64 . includes ( arch ) ) {
120- optionalKeywords . push ( "x86_64" , "X64" )
120+ keywords . push ( [ "x86_64" , "X64" ] )
121121 } else if ( x86 . includes ( arch ) ) {
122122 keywords . push ( "x86" )
123123 } else if ( arm64 . includes ( arch ) ) {
@@ -132,17 +132,17 @@ async function getAssetKeywords(platform: string, arch: string) {
132132 info ( `Using arch ${ arch } for LLVM` )
133133 keywords . push ( arch )
134134 }
135-
135+ keywords . push ( osKeywordsChoice )
136136 break
137137 }
138138 case "darwin" : {
139- optionalKeywords . push ( "apple" , "macos" , "macOS" )
139+ keywords . push ( [ "apple" , "macos" , "macOS" ] )
140140
141141 if ( x86_64 . includes ( arch ) ) {
142- optionalKeywords . push ( "x86_64" , "X64" )
142+ optionalKeywords . push ( [ "x86_64" , "X64" ] )
143143 } else if ( arm64 . includes ( arch ) ) {
144144 // allow falling back to x86_64 if arm64 is not available
145- optionalKeywords . push ( "arm64" , "ARM64" )
145+ optionalKeywords . push ( [ "arm64" , "ARM64" ] )
146146 } else {
147147 info ( `Using arch ${ arch } for LLVM` )
148148 keywords . push ( arch )
0 commit comments