in plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/services/ssm/SsmPlugin.kt [40:57]
override fun downloadVersion(version: FourPartVersion, destinationDir: Path, indicator: ProgressIndicator?): Path {
val downloadUrl = when {
SystemInfo.isWindows -> windowsUrl(version)
SystemInfo.isMac -> macUrl(version)
SystemInfo.isLinux && hasDpkg && CpuArch.isArm64() -> ubuntuArm64Url(version)
SystemInfo.isLinux && hasDpkg && CpuArch.isIntel64() -> ubuntuI64Url(version)
SystemInfo.isLinux && hasRpm2Cpio && CpuArch.isArm64() -> linuxArm64Url(version)
SystemInfo.isLinux && hasRpm2Cpio && CpuArch.isIntel64() -> linuxI64Url(version)
else -> throw IllegalStateException("Failed to find compatible SSM plugin: SystemInfo=${SystemInfo.OS_NAME}, Arch=${SystemInfo.OS_ARCH}")
}
val fileName = downloadUrl.substringAfterLast("/")
val destination = destinationDir.resolve(fileName)
saveFileFromUrl(downloadUrl, destination, indicator)
return destination
}