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 committed Jan 4, 2017
1 parent b0cc70a commit 16fe0c8
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,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 16fe0c8

Please sign in to comment.