File tree Expand file tree Collapse file tree 1 file changed +25
-4
lines changed
Expand file tree Collapse file tree 1 file changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -229,10 +229,31 @@ let installer = (function () {
229229 const recommended = await _getRecommendedCertificate ( ) ;
230230 if ( recommended ) {
231231 // Try to find a release that mentions the recommended certificate in name, tag_name or body
232- const found = releases . find ( r => {
233- const hay = ( ( r . name || "" ) + " " + ( r . tag_name || "" ) + " " + ( r . body || "" ) ) . toLowerCase ( ) ;
234- return hay . includes ( recommended . toLowerCase ( ) ) ;
235- } ) ;
232+ const normalise = s =>
233+ s . toLowerCase ( )
234+ . replace ( / [ ^ a - z 0 - 9 ] + / g, ' ' )
235+ . trim ( ) ;
236+
237+ const recNorm = normalise ( recommended ) ;
238+
239+ const found = releases . find ( r => {
240+ const textHay = normalise (
241+ ( r . name || "" ) + " " +
242+ ( r . tag_name || "" ) + " " +
243+ ( r . body || "" )
244+ ) ;
245+
246+ if ( textHay . includes ( recNorm ) ) return true ;
247+
248+ // 🔥 CHECK ASSET FILENAMES (THIS WAS MISSING)
249+ if ( Array . isArray ( r . assets ) ) {
250+ return r . assets . some ( a =>
251+ a . name && normalise ( a . name ) . includes ( recNorm )
252+ ) ;
253+ }
254+
255+ return false ;
256+ } ) ;
236257 if ( found ) {
237258 chosenRelease = found ;
238259 console . log ( "Using release matched to recommended certificate:" , chosenRelease . name || chosenRelease . tag_name ) ;
You can’t perform that action at this time.
0 commit comments