diff --git a/Sources/SSHCreateKey/SSHCreateKey.swift b/Sources/SSHCreateKey/SSHCreateKey.swift index e2fee463c84a16a346ea9f430dafabb0f9078f20..8c2f84533efee3d6ab6a06eb9ff698bb886b8155 100644 --- a/Sources/SSHCreateKey/SSHCreateKey.swift +++ b/Sources/SSHCreateKey/SSHCreateKey.swift @@ -160,7 +160,7 @@ public final class SSHCreateKey { args.append("-p") args.append(sharedsshport) } else { - args.append(identityfile ?? "") + args.append(sshkeypathandidentityfile ?? "") } args.append(offsiteUsername + "@" + offsiteServer) return args.joined(separator: " ") diff --git a/Tests/SSHCreateKeyTests/SSHCreateKeyTests.swift b/Tests/SSHCreateKeyTests/SSHCreateKeyTests.swift index f447f3951cb164554c366f89fea0a19721210939..70f9b467277ed6de8a172a4aee3a24804859c864 100644 --- a/Tests/SSHCreateKeyTests/SSHCreateKeyTests.swift +++ b/Tests/SSHCreateKeyTests/SSHCreateKeyTests.swift @@ -21,6 +21,8 @@ import Testing print(arg5 ?? "") let arg6 = await sshcreatekey.sshkeypathandidentityfile print(arg6 ?? "") + let arg7 = await sshcreatekey.argumentssshcopyid(offsiteServer: "raspberrypi", offsiteUsername: "thomas") + print(arg7) } } @@ -43,6 +45,8 @@ import Testing print(arg5 ?? "") let arg6 = await sshcreatekey.sshkeypathandidentityfile print(arg6 ?? "") + let arg7 = await sshcreatekey.argumentssshcopyid(offsiteServer: "raspberrypi", offsiteUsername: "thomas") + print(arg7) } }