Update dependencies from https://github.com/dotnet/arcade build 20191216.4 (#5904)
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19616.4
This commit is contained in:
parent
a58fae07a8
commit
1e27202991
4 changed files with 23 additions and 18 deletions
|
@ -98,6 +98,9 @@ function Exec-Process([string]$command, [string]$commandArgs) {
|
|||
}
|
||||
}
|
||||
|
||||
# createSdkLocationFile parameter enables a file being generated under the toolset directory
|
||||
# which writes the sdk's location into. This is only necessary for cmd --> powershell invocations
|
||||
# as dot sourcing isn't possible.
|
||||
function InitializeDotNetCli([bool]$install, [bool]$createSdkLocationFile) {
|
||||
if (Test-Path variable:global:_DotNetInstallDir) {
|
||||
return $global:_DotNetInstallDir
|
||||
|
@ -146,21 +149,23 @@ function InitializeDotNetCli([bool]$install, [bool]$createSdkLocationFile) {
|
|||
}
|
||||
|
||||
$env:DOTNET_INSTALL_DIR = $dotnetRoot
|
||||
}
|
||||
|
||||
if ($createSdkLocationFile) {
|
||||
# Create a temporary file under the toolset dir and rename it to sdk.txt to avoid races.
|
||||
do {
|
||||
$sdkCacheFileTemp = Join-Path $ToolsetDir $([System.IO.Path]::GetRandomFileName())
|
||||
}
|
||||
until (!(Test-Path $sdkCacheFileTemp))
|
||||
Set-Content -Path $sdkCacheFileTemp -Value $dotnetRoot
|
||||
|
||||
try {
|
||||
Rename-Item -Force -Path $sdkCacheFileTemp 'sdk.txt'
|
||||
} catch {
|
||||
# Somebody beat us
|
||||
Remove-Item -Path $sdkCacheFileTemp
|
||||
}
|
||||
# Creates a temporary file under the toolset dir.
|
||||
# The following code block is protecting against concurrent access so that this function can
|
||||
# be called in parallel.
|
||||
if ($createSdkLocationFile) {
|
||||
do {
|
||||
$sdkCacheFileTemp = Join-Path $ToolsetDir $([System.IO.Path]::GetRandomFileName())
|
||||
}
|
||||
until (!(Test-Path $sdkCacheFileTemp))
|
||||
Set-Content -Path $sdkCacheFileTemp -Value $dotnetRoot
|
||||
|
||||
try {
|
||||
Rename-Item -Force -Path $sdkCacheFileTemp 'sdk.txt'
|
||||
} catch {
|
||||
# Somebody beat us
|
||||
Remove-Item -Path $sdkCacheFileTemp
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue