Skip to content

Commit

Permalink
read env vars independently
Browse files Browse the repository at this point in the history
  • Loading branch information
fc1943s committed Aug 18, 2021
1 parent 33d9aa8 commit 7c9cd03
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 7c9cd03

Please sign in to comment.