Skip to content

Commit

Permalink
Merge pull request #332 from chuckries/getclrdbg-release
Browse files Browse the repository at this point in the history
Generate project.json in %TEMP% rather than in install location
  • Loading branch information
chuckries committed May 18, 2016
2 parents d87a77b + 237affa commit 368f7eb
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions scripts/GetClrDbg.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,20 @@ if (-not $RuntimeID) {
}
Write-Host "Info: Using Runtime ID '$RuntimeID'"

# create the install folder if it does not exist
if (-not (Test-Path -Path $InstallPath -PathType Container)) {
New-Item -ItemType Directory -Force -Path $InstallPath
# create the temp folder if it does not exist
$GuidString = [System.Guid]::NewGuid()
$TempPath = Join-Path -Path $env:TEMP -ChildPath $GuidString
if (-not (Test-Path -Path $TempPath -PathType Container)) {
New-Item -ItemType Directory -Force -Path $TempPath
}
$InstallPath = Resolve-Path -Path $InstallPath -ErrorAction Stop
$TempPath = Resolve-Path -Path $TempPath -ErrorAction Stop

Push-Location $InstallPath -ErrorAction Stop
# if we were given a relative path, assume its relative to the script directory and create an absolute path
if (-not([System.IO.Path]::IsPathRooted($InstallPath))) {
$InstallPath = Join-Path -Path (Split-Path -Path $MyInvocation.MyCommand.Definition) -ChildPath $InstallPath
}

Push-Location $TempPath -ErrorAction Stop

Write-Host "Info: Generating project.json"
GenerateProjectJson $VersionNumber $RuntimeID
Expand All @@ -126,4 +133,6 @@ dotnet publish -r $RuntimeID -o $InstallPath

Pop-Location

Remove-Item -Path $TempPath -Recurse -Force

Write-Host "Successfully installed clrdbg at '$InstallPath'"

0 comments on commit 368f7eb

Please sign in to comment.