3 Star 5 Fork 1

海洋饼干 / dotnetty-span-fork

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
init-tools.cmd 2.22 KB
一键复制 编辑 原始数据 按行查看 历史
海洋饼干 提交于 2020-04-27 15:32 . Upgrade to .NET Core 3.1.201 SDK
@if not defined _echo @echo off
setlocal
set INIT_TOOLS_LOG=%~dp0init-tools.log
if [%TOOLRUNTIME_DIR%]==[] set TOOLRUNTIME_DIR=%~dp0Tools
set DOTNET_PATH=%TOOLRUNTIME_DIR%\dotnetcli\
if [%DOTNET_CMD%]==[] set DOTNET_CMD=%DOTNET_PATH%dotnet.exe
set BUILD_TOOLS_SEMAPHORE=%TOOLRUNTIME_DIR%\init-tools.completed
:: if force option is specified then clean the tool runtime and build tools package directory to force it to get recreated
if [%1]==[force] (
if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%"
)
:: If semaphore exists do nothing
if exist "%BUILD_TOOLS_SEMAPHORE%" (
echo Tools are already initialized.
goto :EOF
)
if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%"
echo Running %0 > "%INIT_TOOLS_LOG%"
set /p DOTNET_VERSION=< "%~dp0DotnetCLIVersion.txt"
if exist "%DOTNET_CMD%" goto :afterdotnetrestore
echo Installing dotnet cli...
if NOT exist "%DOTNET_PATH%" mkdir "%DOTNET_PATH%"
set DOTNET_ZIP_NAME=dotnet-sdk-%DOTNET_VERSION%-win-x64.zip
set DOTNET_REMOTE_PATH=https://dotnetcli.azureedge.net/dotnet/Sdk/%DOTNET_VERSION%/%DOTNET_ZIP_NAME%
set DOTNET_LOCAL_PATH=%DOTNET_PATH%%DOTNET_ZIP_NAME%
echo Installing '%DOTNET_REMOTE_PATH%' to '%DOTNET_LOCAL_PATH%' >> "%INIT_TOOLS_LOG%"
powershell -NoProfile -ExecutionPolicy unrestricted -Command "$retryCount = 0; $success = $false; do { try { (New-Object Net.WebClient).DownloadFile('%DOTNET_REMOTE_PATH%', '%DOTNET_LOCAL_PATH%'); $success = $true; } catch { if ($retryCount -ge 6) { throw; } else { $retryCount++; Start-Sleep -Seconds (5 * $retryCount); } } } while ($success -eq $false); Add-Type -Assembly 'System.IO.Compression.FileSystem' -ErrorVariable AddTypeErrors; if ($AddTypeErrors.Count -eq 0) { [System.IO.Compression.ZipFile]::ExtractToDirectory('%DOTNET_LOCAL_PATH%', '%DOTNET_PATH%') } else { (New-Object -com shell.application).namespace('%DOTNET_PATH%').CopyHere((new-object -com shell.application).namespace('%DOTNET_LOCAL_PATH%').Items(),16) }" >> "%INIT_TOOLS_LOG%"
if NOT exist "%DOTNET_LOCAL_PATH%" (
echo ERROR: Could not install dotnet cli correctly. See '%INIT_TOOLS_LOG%' for more details. 1>&2
exit /b 1
)
:afterdotnetrestore
:: Create semaphore file
echo Done initializing tools.
echo Init-Tools.cmd completed. > "%BUILD_TOOLS_SEMAPHORE%"
exit /b 0
C#
1
https://gitee.com/cuteant/dotnetty-span-fork.git
git@gitee.com:cuteant/dotnetty-span-fork.git
cuteant
dotnetty-span-fork
dotnetty-span-fork
main

搜索帮助