Skip to content

Commit

Permalink
Merge pull request #4074 from fc1943s/master
Browse files Browse the repository at this point in the history
read env vars independently with nuget authentication
  • Loading branch information
forki authored Aug 24, 2021
2 parents 33d9aa8 + 7c9cd03 commit 2606635
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/Paket.Core/Versioning/PackageSources.fs
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,15 @@ let internal parseAuth(text:string, source) =
else NetUtils.AuthType.Basic

let auth =
match EnvironmentVariable.Create(username),
EnvironmentVariable.Create(password) with
| Some userNameVar, Some passwordVar ->
{Username = userNameVar.Value; Password = passwordVar.Value; Type = authType }
| _, _ ->
{Username = username; Password = password; Type = authType }
{ Username =
EnvironmentVariable.Create(username)
|> Option.map (fun var -> var.Value)
|> Option.defaultValue username
Password =
EnvironmentVariable.Create(password)
|> Option.map (fun var -> var.Value)
|> Option.defaultValue password
Type = authType }

match auth with
| {Username = username; Password = password} when username = "" && password = "" -> getAuth()
Expand Down

0 comments on commit 2606635

Please sign in to comment.