backend name is now package manager name, error if incorrect in conf file
This commit is contained in:
parent
492ce2f9cc
commit
72aceb035d
@ -5,7 +5,7 @@ require "../backends.cr"
|
||||
|
||||
class BaguetteBackend < Package::Backend::Packaging
|
||||
def initialize
|
||||
@name = "baguette"
|
||||
@name = "package"
|
||||
end
|
||||
|
||||
def package(context : Package::Context, package : Package::Package) : Bool
|
||||
|
@ -283,7 +283,17 @@ class Package::Context
|
||||
end
|
||||
when "package-manager"
|
||||
# Targeted package manager (default: package, for BaguetteOS).
|
||||
self.packaging_backend = value.as_s
|
||||
begin
|
||||
self.packaging_backend = value.as_s
|
||||
rescue e
|
||||
STDERR.puts "Error during selecting packaging backend: #{e}"
|
||||
STDERR.puts "#{value.as_s} seems not to be a valid backend"
|
||||
STDERR.puts "valid backends:"
|
||||
@packaging_backends.each do |backend|
|
||||
STDERR.puts "- #{backend.name}"
|
||||
end
|
||||
exit 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user