From b83bce4544bff2103951973cc32b990d076053e8 Mon Sep 17 00:00:00 2001 From: Nikolay Edigaryev Date: Tue, 2 Aug 2022 16:52:35 +0300 Subject: [PATCH] tart login: read whole stdin contents instead of just a line (#170) --- Sources/tart/Commands/Login.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/tart/Commands/Login.swift b/Sources/tart/Commands/Login.swift index 9f94587..990145d 100644 --- a/Sources/tart/Commands/Login.swift +++ b/Sources/tart/Commands/Login.swift @@ -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() }