File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import * as fs from 'fs'
3
3
import * as crypto from 'crypto'
4
4
import * as path from 'path'
5
5
import * as os from 'os'
6
+ import * as semver from 'semver'
6
7
import AdmZip from 'adm-zip'
7
8
8
9
interface ManifestContent {
@@ -27,6 +28,7 @@ interface ManifestVersion {
27
28
interface Manifest {
28
29
versions : ManifestVersion [ ]
29
30
}
31
+
30
32
async function verifyFileHash ( filePath : string , expectedHash : string ) : Promise < boolean > {
31
33
return new Promise ( ( resolve , reject ) => {
32
34
const hash = crypto . createHash ( 'sha384' )
@@ -86,7 +88,7 @@ export async function downloadLanguageServer(): Promise<void> {
86
88
87
89
const latestVersion = manifest . versions
88
90
. filter ( ( v ) => ! v . isDelisted )
89
- . sort ( ( a , b ) => b . serverVersion . localeCompare ( a . serverVersion ) ) [ 0 ]
91
+ . sort ( ( a , b ) => semver . compare ( b . serverVersion , a . serverVersion ) ) [ 0 ]
90
92
91
93
if ( ! latestVersion ) {
92
94
throw new Error ( 'No valid version found in manifest' )
You can’t perform that action at this time.
0 commit comments