lib/fig/environment.rb in fig-0.1.22 vs lib/fig/environment.rb in fig-0.1.23
- old
+ new
@@ -24,11 +24,14 @@
@retrieve_vars[name] = path
end
def register_package(package)
name = package.package_name
- raise "Package already exists with name: #{name}" if @packages[name]
+ if @packages[name]
+ puts "Package already exists with name: #{name}"
+ exit 10
+ end
@packages[name] = package
end
def apply_config(package, config_name)
config = package[config_name]
@@ -119,11 +122,12 @@
package = @packages[package_name]
if package.nil?
package = @repository.load_package(package_name, version_name || DEFAULT_VERSION_NAME)
@packages[package_name] = package
elsif version_name && version_name != package.version_name
- raise "Version mismatch: #{package_name}"
+ puts "Version mismatch: #{package_name}"
+ exit 10
end
package
end
# Replace @ symbol with the package's directory
@@ -149,10 +153,13 @@
end
def expand_arg(arg)
arg.gsub(/\@([a-zA-Z0-9\-\.]+)/) do |match|
package = @packages[$1]
- raise "Package not found: #{$1}" if package.nil?
+ if package.nil?
+ puts "Package not found: #{$1}"
+ exit 10
+ end
package.directory
end
end
end
end