Convert combine by: '||' to any
This commit is contained in:
@@ -62,6 +62,10 @@ module Kamal::Commands
|
|||||||
combine *commands, by: ">"
|
combine *commands, by: ">"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def any(*commands)
|
||||||
|
combine *commands, by: "||"
|
||||||
|
end
|
||||||
|
|
||||||
def xargs(command)
|
def xargs(command)
|
||||||
[ :xargs, command ].flatten
|
[ :xargs, command ].flatten
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -24,7 +24,10 @@ class Kamal::Commands::Builder::Base < Kamal::Commands::Base
|
|||||||
def validate_image
|
def validate_image
|
||||||
pipe \
|
pipe \
|
||||||
docker(:inspect, "-f", "'{{ .Config.Labels.service }}'", config.absolute_image),
|
docker(:inspect, "-f", "'{{ .Config.Labels.service }}'", config.absolute_image),
|
||||||
[:grep, "-x", config.service, "||", "(echo \"Image #{config.absolute_image} is missing the 'service' label\" && exit 1)"]
|
any(
|
||||||
|
[:grep, "-x", config.service],
|
||||||
|
"(echo \"Image #{config.absolute_image} is missing the 'service' label\" && exit 1)"
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class Kamal::Commands::Traefik < Kamal::Commands::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def start_or_run
|
def start_or_run
|
||||||
combine start, run, by: "||"
|
any start, run
|
||||||
end
|
end
|
||||||
|
|
||||||
def info
|
def info
|
||||||
|
|||||||
Reference in New Issue
Block a user