mirror of
https://github.com/cirruslabs/tart.git
synced 2026-10-04 05:01:23 +02:00
tart login: trim newline characters at the end of --password-stdin (#486)
This commit is contained in:
@@ -35,6 +35,9 @@ struct Login: AsyncParsableCommand {
|
||||
|
||||
let passwordData = FileHandle.standardInput.readDataToEndOfFile()
|
||||
password = String(decoding: passwordData, as: UTF8.self)
|
||||
|
||||
// Support "echo $PASSWORD | tart login --username $USERNAME --password-stdin $REGISTRY"
|
||||
password.trimSuffix { c in c.isNewline }
|
||||
} else {
|
||||
(user, password) = try StdinCredentials.retrieve()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user