Merge pull request #517 from ernstk/patch-1
Allow any custom chocolatey source
This commit is contained in:
commit
4000eddb69
1 changed files with 6 additions and 2 deletions
|
@ -112,9 +112,9 @@ Else
|
|||
If ($params.source)
|
||||
{
|
||||
$source = $params.source.ToString().ToLower()
|
||||
If (($source -ne "chocolatey") -and ($source -ne "webpi") -and ($source -ne "windowsfeatures") -and ($source -ne "ruby"))
|
||||
If (($source -ne "chocolatey") -and ($source -ne "webpi") -and ($source -ne "windowsfeatures") -and ($source -ne "ruby") -and (!$source.startsWith("http://", "CurrentCultureIgnoreCase")) -and (!$source.startsWith("https://", "CurrentCultureIgnoreCase")))
|
||||
{
|
||||
Fail-Json $result "source is $source - must be one of chocolatey, ruby, webpi or windowsfeatures."
|
||||
Fail-Json $result "source is $source - must be one of chocolatey, ruby, webpi, windowsfeatures or a custom source url."
|
||||
}
|
||||
}
|
||||
Elseif (!$params.source)
|
||||
|
@ -190,6 +190,10 @@ elseif (($source -eq "windowsfeatures") -or ($source -eq "webpi") -or ($source -
|
|||
{
|
||||
$expression += " -source $source"
|
||||
}
|
||||
elseif(($source -ne $Null) -and ($source -ne ""))
|
||||
{
|
||||
$expression += " -source $source"
|
||||
}
|
||||
|
||||
Set-Attr $result "chocolatey command" $expression
|
||||
$op_result = invoke-expression $expression
|
||||
|
|
Loading…
Reference in a new issue