Skip to content

Commit

Permalink
Merge pull request #273 from jgawor/empty_repo_root
Browse files Browse the repository at this point in the history
#269: Ignore empty repository roots
  • Loading branch information
opiethehokie committed Mar 10, 2016
2 parents 2a3c175 + 1da3df6 commit e2ab02e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion resources/download_buildpack_cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,18 @@ def collect_configs(config_files = nil, cached_hosts = nil, exclude_files = nil)
end
unless config.nil?
config = config[DRIVER] || config
if config.has_key?(REPOSITORY_ROOT) && config.has_key?(VERSION) && (File.exists?(index_path(config)) || cached_hosts.nil? || cached_hosts.include?(URI(repository_root(config)).host))
if repository_configuration?(config) && (File.exists?(index_path(config)) || cached_hosts.nil? || cached_hosts.include?(URI(repository_root(config)).host))
configs.push(config)
end
end
end
configs
end

def repository_configuration?(configuration)
configuration.has_key?(VERSION) && configuration.has_key?(REPOSITORY_ROOT) && !configuration[REPOSITORY_ROOT].empty?
end

def default_repository_root
LibertyBuildpack::Util::ConfigurationUtils.load('repository', false)['default_repository_root'].chomp('/')
end
Expand Down

0 comments on commit e2ab02e

Please sign in to comment.