Changed SSH key comment

This commit is contained in:
Alex Lavallee 2020-11-29 15:40:52 -08:00
parent 6c3748b6bf
commit c5dae4f08b

View File

@ -21,19 +21,19 @@ struct SecretDetailView<SecretType: Secret>: View {
.frame(minHeight: 200, maxHeight: .infinity)
}
var dashedKeyName: String {
secret.name.replacingOccurrences(of: " ", with: "-")
var dashedUserName: String {
NSUserName().replacingOccurrences(of: " ", with: "-")
}
var dashedHostName: String {
["secretive", Host.current().localizedName, "local"]
[Host.current().localizedName, "local"]
.compactMap { $0 }
.joined(separator: ".")
.replacingOccurrences(of: " ", with: "-")
}
var keyString: String {
keyWriter.openSSHString(secret: secret, comment: "\(dashedKeyName)@\(dashedHostName)")
keyWriter.openSSHString(secret: secret, comment: "\(dashedUserName)@\(dashedHostName)")
}
func copy() {