From 69fa7286e2b8ea552c76d39b4de945ab83fc1711 Mon Sep 17 00:00:00 2001 From: Donal McBreen Date: Mon, 24 Jun 2024 08:21:03 +0100 Subject: [PATCH] Match a "does not exist" error message Only show the warning for building when we are actually going to do that and match `does not exist` in the error message. Fixes: https://github.com/basecamp/kamal/issues/851 --- lib/kamal/cli/build.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/kamal/cli/build.rb b/lib/kamal/cli/build.rb index 54d4d6db..3508079f 100644 --- a/lib/kamal/cli/build.rb +++ b/lib/kamal/cli/build.rb @@ -43,8 +43,8 @@ class Kamal::Cli::Build < Kamal::Cli::Base cli.create end rescue SSHKit::Command::Failed => e - warn "Missing compatible builder, so creating a new one first" - if e.message =~ /(context not found|no builder)/ + if e.message =~ /(context not found|no builder|does not exist)/ + warn "Missing compatible builder, so creating a new one first" cli.create else raise