Skip to content

Commit

Permalink
Add prune_white_list to config file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Guido Marucci Blas committed Jan 4, 2017
1 parent 227a870 commit 10f6e6e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/carthage_cache/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,17 @@ def install_archive
def create_archive(force = false, prune = nil, prune_white_list = nil, platforms = nil)
prune ||= config.prune_on_publish
platforms ||= config.platforms
prune_white_list ||= config.prune_white_list

if force || !archive_exist?
prune_build_directory(prune_white_list) if prune
archive_builder.build(platforms)
end
end

def prune_build_directory(white_list)
white_list ||= config.prune_white_list

if white_list && File.exist?(white_list)
terminal.vputs "Prunning build directory with white list '#{white_list}' ..."
white_list = YAML.load(File.read(white_list))
Expand Down
2 changes: 2 additions & 0 deletions lib/carthage_cache/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def self.default
@default ||= Configuration.new({
prune_on_publish: false,
platforms: nil,
prune_white_list: nil,
aws_s3_client_options: {
region: ENV['AWS_REGION'],
access_key_id: ENV['AWS_ACCESS_KEY_ID'],
Expand All @@ -40,6 +41,7 @@ def self.default

config_key :bucket_name
config_key :prune_on_publish
config_key :prune_white_list
config_key :platforms
config_key :aws_region
config_key :aws_access_key_id
Expand Down

0 comments on commit 10f6e6e

Please sign in to comment.