Publish test package at AGENT_WORKFOLDER if TEMP is not available (#8108)

This commit is contained in:
Aditya Patwardhan 2018-10-23 16:31:04 -07:00 committed by GitHub
parent 082c3b0bae
commit 05e9f78bcb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2997,7 +2997,13 @@ function New-TestPackage
Write-Verbose -Message "Creating destination folder: $Destination"
}
$packageRoot = Join-Path $env:TEMP ('TestPackage-' + (new-guid))
$rootFolder = $env:TEMP
if (-not $rootFolder -and $env:TF_BUILD) {
$rootFolder = $env:AGENT_WORKFOLDER
}
$packageRoot = Join-Path $rootFolder ('TestPackage-' + (new-guid))
$null = New-Item -ItemType Directory -Path $packageRoot -Force
$packagePath = Join-Path $Destination "TestPackage.zip"