35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# File 'lib/middleman-s3_sync/commands.rb', line 35
def s3_sync
::Middleman::S3Sync.app = ::Middleman::Application.server.inst do
config[:environment] = :build
end
s3_sync_options = ::Middleman::S3Sync.s3_sync_options
bucket = s3_sync_options.bucket rescue nil
unless bucket
raise Thor::Error.new "You need to activate the s3_sync extension and at least provide the bucket name."
end
s3_sync_options.force = options[:force] if options[:force]
s3_sync_options.bucket = options[:bucket] if options[:bucket]
s3_sync_options.verbose = options[:verbose] if options[:verbose]
if options[:prefix]
s3_sync_options.prefix = options[:prefix] if options[:prefix]
s3_sync_options.prefix = s3_sync_options.prefix.end_with?("/") ? s3_sync_options.prefix : s3_sync_options.prefix + "/"
end
s3_sync_options.dry_run = options[:dry_run] if options[:dry_run]
::Middleman::S3Sync.sync()
end
|