2015-12-28 19:47:21 +00:00
|
|
|
#
|
|
|
|
# Copyright (c) .NET Foundation and contributors. All rights reserved.
|
|
|
|
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
|
|
#
|
|
|
|
|
2015-11-30 20:17:41 +00:00
|
|
|
$oldPath = $env:PATH
|
|
|
|
try {
|
|
|
|
# Put the stage2 output on the front of the path
|
2016-03-02 01:42:44 +00:00
|
|
|
if(!(Get-Command dotnet -ErrorAction SilentlyContinue)) {
|
|
|
|
throw "You need to have a version of 'dotnet' on your path so we can determine the RID"
|
|
|
|
}
|
|
|
|
|
|
|
|
$rid = dotnet --version | where { $_ -match "^ Runtime Id:\s*(.*)$" } | foreach { $matches[1] }
|
|
|
|
$stage2 = "$PSScriptRoot\..\artifacts\$rid\stage2\bin"
|
2015-11-30 20:17:41 +00:00
|
|
|
if (Test-Path $stage2) {
|
|
|
|
$env:PATH="$stage2;$env:PATH"
|
|
|
|
} else {
|
2017-05-26 22:46:56 +00:00
|
|
|
Write-Output "You don't have a dev build in the 'artifacts\$rid\stage2' folder!"
|
2015-11-30 20:17:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dotnet @args
|
|
|
|
} finally {
|
|
|
|
$env:PATH = $oldPath
|
|
|
|
}
|