diff --git a/scripts/enable-dev.sh b/scripts/enable-dev.sh deleted file mode 100644 index 8127c0a35..000000000 --- a/scripts/enable-dev.sh +++ /dev/null @@ -1,41 +0,0 @@ -# -# 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. -# - -# This script is NOT executable. It MUST be sourced! - -if [ ! -z "$BASH_SOURCE" ]; then - SOURCE="${BASH_SOURCE}" -elif [ ! -z "$ZSH_VERSION" ]; then - SOURCE="$0" -else - echo "Unsupported shell, this requires bash or zsh" 1>&2 - exit 1 -fi - -while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located -done -DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" -REPOROOT="$( cd -P "$DIR/.." && pwd )" - -UNAME=$(uname) - -if [ -z "$RID" ]; then - if [ "$UNAME" == "Darwin" ]; then - OSNAME=osx - RID=osx.10.10-x64 - elif [ "$UNAME" == "Linux" ]; then - # Detect Distro? - OSNAME=linux - RID=ubuntu.14.04-x64 - else - error "unknown OS: $UNAME" 1>&2 - exit 1 - fi -fi - -export DOTNET_TOOLS=$REPOROOT/artifacts/$RID/stage2 diff --git a/scripts/unuse-dev.ps1 b/scripts/unuse-dev.ps1 new file mode 100644 index 000000000..eefd11bc6 --- /dev/null +++ b/scripts/unuse-dev.ps1 @@ -0,0 +1,4 @@ +# Remove the stage2 output from the path +$splat = $env:PATH.Split(";") +$stripped = @($splat | where { $_ -notlike "*artifacts\win7-x64\stage2*" }) +$env:PATH = [string]::Join(";", $stripped) diff --git a/scripts/use-dev.ps1 b/scripts/use-dev.ps1 new file mode 100644 index 000000000..93a549810 --- /dev/null +++ b/scripts/use-dev.ps1 @@ -0,0 +1,11 @@ +# Put the stage2 output on the front of the path +$stage2 = "$PSScriptRoot\..\artifacts\win7-x64\stage2\bin" +if (Test-Path $stage2) { + $splat = $env:PATH.Split(";") + $stage2 = Convert-Path $stage2 + if ($splat -notcontains $stage2) { + $env:PATH="$stage2;$env:PATH" + } +} else { + Write-Host "You don't have a dev build in the 'artifacts\win7-x64\stage2' folder!" +}