Check protocol is SSH before connecting

This commit is contained in:
Donal McBreen
2023-09-12 08:25:24 +01:00
parent 6a3b0249fe
commit 8424458174

View File

@@ -112,9 +112,11 @@ class Kamal::Cli::Build < Kamal::Cli::Base
def connect_to_remote_host(remote_host)
remote_uri = URI.parse(remote_host)
options = { user: remote_uri.user, port: remote_uri.port }.compact
on(remote_uri.host, options) do
execute "true"
if remote_uri.scheme == "ssh"
options = { user: remote_uri.user, port: remote_uri.port }.compact
on(remote_uri.host, options) do
execute "true"
end
end
end
end