Skip to content

Commit

Permalink
Attempt to wait on sshpass to get logged in.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaiede committed Jan 6, 2024
1 parent 92dba31 commit 9ff5a59
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions Sources/Bedrockifier/Model/ContainerConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ public struct SSHConnectionConfig: ContainerConnectionConfig {
return [
// sshpass arguments
"-e",
"-v",
// ssh arguments
sshPath,
"-p",
Expand Down
8 changes: 8 additions & 0 deletions Sources/Bedrockifier/Model/ContainerConnection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ public class ContainerConnection {
terminalProcess.environment = environment

try terminalProcess.run()

if connectionConfig.kind == "ssh" {
let result = await terminal.expect(["SSHPASS: detected prompt. Sending password.", "SSHPASS: read:"], timeout: 60.0)
if result == .noMatch {
Library.log.error("SSH connection doesn't seem to have been made properly")
}
}

logTerminalSize()
}

Expand Down

0 comments on commit 9ff5a59

Please sign in to comment.