WIP optional tokens.
parent
df718d2a9e
commit
3349c3f251
|
@ -79,6 +79,8 @@ commands.push "add", "Adds a service to an environment." do |args|
|
||||||
provider = service.get_default_provider token.token
|
provider = service.get_default_provider token.token
|
||||||
end
|
end
|
||||||
|
|
||||||
|
next if provider.nil? && token.optional
|
||||||
|
|
||||||
if provider.nil?
|
if provider.nil?
|
||||||
STDERR.puts "This service consumes a “#{token.token}” token, but you have not specified what other service is supposed to provide it."
|
STDERR.puts "This service consumes a “#{token.token}” token, but you have not specified what other service is supposed to provide it."
|
||||||
STDERR.puts "Use the `service add #{args[1]} #{token.token}=<provider>` syntax to specify it."
|
STDERR.puts "Use the `service add #{args[1]} #{token.token}=<provider>` syntax to specify it."
|
||||||
|
|
|
@ -4,6 +4,7 @@ require "specparser"
|
||||||
class ServiceDefinition
|
class ServiceDefinition
|
||||||
struct Consumes
|
struct Consumes
|
||||||
getter token : String
|
getter token : String
|
||||||
|
getter optional : Bool
|
||||||
def initialize(@token)
|
def initialize(@token)
|
||||||
@optional = false
|
@optional = false
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue