fun downloadAndUnzip()

in src/main/kotlin/co/huggingface/llmintellij/lsp/LlmLsLspServerDescriptor.kt [82:95]


fun downloadAndUnzip(url: String, binDir: File, binName: String, fullPath: String) {
    val path = File(binDir, binName).absolutePath
    val downloadCommand = "curl -L -o $path.gz $url"
    val unzipCommand = "gunzip $path.gz"
    val renameCommand = "mv $path $fullPath"
    val chmodCommand = "chmod +x $fullPath"
    val cleanZipCommand = "rm $path.gz"

    runCommand(downloadCommand)
    runCommand(unzipCommand)
    runCommand(renameCommand)
    runCommand(chmodCommand)
    runCommand(cleanZipCommand)
}