diff --git a/lib/carthage_cache/application.rb b/lib/carthage_cache/application.rb index d4edf80..c0f51b2 100644 --- a/lib/carthage_cache/application.rb +++ b/lib/carthage_cache/application.rb @@ -38,6 +38,8 @@ 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) @@ -45,6 +47,8 @@ def create_archive(force = false, prune = nil, prune_white_list = nil, platforms 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)) diff --git a/lib/carthage_cache/configuration.rb b/lib/carthage_cache/configuration.rb index 48b88dd..e47cea2 100644 --- a/lib/carthage_cache/configuration.rb +++ b/lib/carthage_cache/configuration.rb @@ -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'], @@ -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