Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion scripts/lspArtifact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as fs from 'fs'
import * as crypto from 'crypto'
import * as path from 'path'
import * as os from 'os'
import * as semver from 'semver'
import AdmZip from 'adm-zip'

interface ManifestContent {
Expand All @@ -27,6 +28,7 @@ interface ManifestVersion {
interface Manifest {
versions: ManifestVersion[]
}

async function verifyFileHash(filePath: string, expectedHash: string): Promise<boolean> {
return new Promise((resolve, reject) => {
const hash = crypto.createHash('sha384')
Expand Down Expand Up @@ -86,7 +88,7 @@ export async function downloadLanguageServer(): Promise<void> {

const latestVersion = manifest.versions
.filter((v) => !v.isDelisted)
.sort((a, b) => b.serverVersion.localeCompare(a.serverVersion))[0]
.sort((a, b) => semver.compare(b.serverVersion, a.serverVersion))[0]

if (!latestVersion) {
throw new Error('No valid version found in manifest')
Expand Down
Loading