Skip to content

Commit

Permalink
tart login: read whole stdin contents instead of just a line (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
edigaryev authored Aug 2, 2022
1 parent 7d16516 commit b83bce4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/tart/Commands/Login.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ struct Login: AsyncParsableCommand {

if let username = username {
user = username
password = readLine()!

let passwordData = FileHandle.standardInput.readDataToEndOfFile()
password = String(decoding: passwordData, as: UTF8.self)
} else {
(user, password) = try StdinCredentials.retrieve()
}
Expand Down

0 comments on commit b83bce4

Please sign in to comment.