File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,16 @@ function getSanitizedLinuxName (ext) {
105105 }
106106}
107107
108+ function getSanitizedName ( release ) {
109+ if ( release . url . includes ( 'linux' ) ) {
110+ return getSanitizedLinuxName ( release . ext )
111+ }
112+
113+ const match = release . url . match ( / ^ .* \/ .* - \d + \. \d + \. \d + - ( [ ^ . ] * ) \. ( .* ) $ / )
114+
115+ return match && match . length === 3 ? `${ match [ 1 ] } .${ match [ 2 ] } ` : release . ext
116+ }
117+
108118export async function setupDownloadButton ( ) {
109119 const os = getOS ( ) ;
110120 const downloadParent = document . getElementById ( "downloads" ) ;
@@ -147,7 +157,7 @@ export async function setupDownloadButton () {
147157 for ( const release of releases ) {
148158 const optionDiv = document . createElement ( 'div' )
149159 optionDiv . classList . add ( 'option' )
150- optionDiv . innerHTML = `${ getSanitizedLinuxName ( release . ext ) } `
160+ optionDiv . innerHTML = `${ getSanitizedName ( release ) } `
151161 optionsContainer . appendChild ( optionDiv )
152162
153163 optionDiv . onclick = ( ) => window . open ( release . url )
You can’t perform that action at this time.
0 commit comments