加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
install.ps1 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
Shougo Matsushita 提交于 2021-04-05 21:02 . Remove zip
[Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls"
$web = New-Object Net.WebClient
$versionUrl = "https://update.tabnine.com/bundles/version"
$version = $web.DownloadString($versionUrl).replace("`n","")
$arch_raw = Get-CimInstance Win32_OperatingSystem | Select-Object 'OSArchitecture' | Format-Table -HideTableHeaders | Out-String
switch ( $arch_raw.Trim().Substring(0,2) ) {
"64" { $arch = "x86_64" }
"32" { $arch = "i686" }
}
$triple = ( $arch + "-pc-windows-gnu" )
$path = "$PSScriptRoot\binaries\$version\$triple"
$url = ( "https://update.tabnine.com/bundles/$version/$triple/TabNine.zip" )
if (!(Test-Path -Path "$path\TabNine.exe")) {
Write-Host "Downloading TabNine executable..."
New-Item -ItemType directory -Path $path
Try {
$web.DownloadFile(
$url,
$ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath(
"$path\TabNine.zip"
)
)
Expand-Archive -Force -Path "$path\TabNine.zip" -DestinationPath "$path"
Remove-Item "$path\TabNine.zip"
Write-Host "Successful!"
}
Catch {
Write-Host $($_.Exception.ToString())
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化