From 842445817449ffea88b1485eb8d720bf31286fcd Mon Sep 17 00:00:00 2001 From: Donal McBreen Date: Tue, 12 Sep 2023 08:25:24 +0100 Subject: [PATCH] Check protocol is SSH before connecting --- lib/kamal/cli/build.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/kamal/cli/build.rb b/lib/kamal/cli/build.rb index 379fd12a..3b64e89b 100644 --- a/lib/kamal/cli/build.rb +++ b/lib/kamal/cli/build.rb @@ -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