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
This commit is contained in:
Donal McBreen
2024-06-24 08:21:03 +01:00
parent 4697f89441
commit 69fa7286e2

View File

@@ -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