Skip to content

Commit

Permalink
(chocolateyGH-1117) Get-ChocolateyWebFile - Url Overrides
Browse files Browse the repository at this point in the history
Allow urls to be overridden based on environment variables.
  • Loading branch information
ferventcoder authored and Russell Mora committed Jan 23, 2017
1 parent 246c205 commit 7b5f74e
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,12 @@ param(

Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters

# url overrides
$urlOverride = $env:ChocolateyUrlOverride
$url64bitOverride = $env:ChocolateyUrl64bitOverride
if ($urlOverride -ne $null -and $urlOverride -ne '') { $url = $urlOverride }
if ($url64bitOverride -ne $null -and $url64bitOverride -ne '') { $url64bit = $url64bitOverride }

if ($url -ne $null) { $url = $url.Replace("//","/").Replace(":/","://") }
if ($url64bit -ne $null) { $url64bit = $url64bit.Replace("//","/").Replace(":/","://") }

Expand Down

0 comments on commit 7b5f74e

Please sign in to comment.