Skip to content

Commit 198700a

Browse files
Updates Linux setup scripts. Closes #744 (#746)
1 parent 165f267 commit 198700a

File tree

4 files changed

+34
-16
lines changed

4 files changed

+34
-16
lines changed

scripts/setup-beta.ps1

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,15 @@ Set-Location .\devproxy | Out-Null
3535
# Get the full path of the current directory
3636
$full_path = Resolve-Path .
3737

38-
# Get the latest beta Dev Proxy version
39-
Write-Host "Getting latest beta Dev Proxy version..."
40-
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/microsoft/dev-proxy/releases?per_page=1" -ErrorAction Stop
41-
$version = $response[0].tag_name
42-
Write-Host "Latest beta version is $version"
38+
if (-not $env:DEV_PROXY_VERSION) {
39+
# Get the latest beta Dev Proxy version
40+
Write-Host "Getting latest beta Dev Proxy version..."
41+
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/microsoft/dev-proxy/releases?per_page=1" -ErrorAction Stop
42+
$version = $response[0].tag_name
43+
Write-Host "Latest beta version is $version"
44+
} else {
45+
$version = $env:DEV_PROXY_VERSION
46+
}
4347

4448
# Download Dev Proxy
4549
Write-Host "Downloading Dev Proxy $version..."

scripts/setup-beta.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,14 @@ full_path=$(pwd)
4343

4444
set -e # Terminates program immediately if any command below exits with a non-zero exit status
4545

46-
echo "Getting latest beta Dev Proxy version..."
47-
version=$(curl -s "https://api.github.com/repos/microsoft/dev-proxy/releases?per_page=1" | awk -F: '/"tag_name"/ {print $2}' | sed 's/[", ]//g')
48-
echo "Latest beta version is $version"
46+
if [ -z "$0" ]
47+
then
48+
echo "Getting latest beta Dev Proxy version..."
49+
version=$(curl -s "https://api.github.com/repos/microsoft/dev-proxy/releases?per_page=1" | awk -F: '/"tag_name"/ {print $2}' | sed 's/[", ]//g')
50+
echo "Latest beta version is $version"
51+
else
52+
version=$0
53+
fi
4954

5055
echo "Downloading Dev Proxy $version..."
5156

scripts/setup.ps1

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,15 @@ Set-Location .\devproxy | Out-Null
3434
# Get the full path of the current directory
3535
$full_path = Resolve-Path .
3636

37-
# Get the latest Dev Proxy version
38-
Write-Host "Getting latest Dev Proxy version..."
39-
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/microsoft/dev-proxy/releases/latest" -ErrorAction Stop
40-
$version = $response.tag_name
41-
Write-Host "Latest version is $version"
37+
if (-not $env:DEV_PROXY_VERSION) {
38+
# Get the latest Dev Proxy version
39+
Write-Host "Getting latest Dev Proxy version..."
40+
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/microsoft/dev-proxy/releases/latest" -ErrorAction Stop
41+
$version = $response.tag_name
42+
Write-Host "Latest version is $version"
43+
} else {
44+
$version = $env:DEV_PROXY_VERSION
45+
}
4246

4347
# Download Dev Proxy
4448
Write-Host "Downloading Dev Proxy $version..."

scripts/setup.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,14 @@ full_path=$(pwd)
4242

4343
set -e # Terminates program immediately if any command below exits with a non-zero exit status
4444

45-
echo "Getting latest Dev Proxy version..."
46-
version=$(curl -s https://api.github.com/repos/microsoft/dev-proxy/releases/latest | awk -F: '/"tag_name"/ {print $2}' | sed 's/[", ]//g')
47-
echo "Latest version is $version"
45+
if [ -z "$0" ]
46+
then
47+
echo "Getting latest Dev Proxy version..."
48+
version=$(curl -s https://api.github.com/repos/microsoft/dev-proxy/releases/latest | awk -F: '/"tag_name"/ {print $2}' | sed 's/[", ]//g')
49+
echo "Latest version is $version"
50+
else
51+
version=$0
52+
fi
4853

4954
echo "Downloading Dev Proxy $version..."
5055

0 commit comments

Comments
 (0)