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'
33import * as crypto from 'crypto'
44import * as path from 'path'
55import * as os from 'os'
6+ import * as semver from 'semver'
67import AdmZip from 'adm-zip'
78
89interface ManifestContent {
@@ -27,6 +28,7 @@ interface ManifestVersion {
2728interface Manifest {
2829 versions : ManifestVersion [ ]
2930}
31+
3032async function verifyFileHash ( filePath : string , expectedHash : string ) : Promise < boolean > {
3133 return new Promise ( ( resolve , reject ) => {
3234 const hash = crypto . createHash ( 'sha384' )
@@ -86,7 +88,7 @@ export async function downloadLanguageServer(): Promise<void> {
8688
8789 const latestVersion = manifest . versions
8890 . 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 ]
9092
9193 if ( ! latestVersion ) {
9294 throw new Error ( 'No valid version found in manifest' )
You can’t perform that action at this time.
0 commit comments