tart login: read whole stdin contents instead of just a line (#170)

This commit is contained in:
Nikolay Edigaryev 2022-08-02 16:52:35 +03:00 committed by GitHub
parent 7d16516b6a
commit b83bce4544
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -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()
}