Skip to content

Commit

Permalink
Overriding the prefix from the command line.
Browse files Browse the repository at this point in the history
  • Loading branch information
fredjean committed May 9, 2015
1 parent 4cf2113 commit cb7b6a1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,18 @@ such case, you can pass the ```--force``` option:

## Overriding the destination bucket

You can now override the destination bucket using the --bucket switch.
You can override the destination bucket using the --bucket switch.
The command is:

$ middleman s3_sync --bucket=my.new.bucket

## Overriding the destination prefix

You can override the destination prefix using the `--prefix` switch. The
command is:

$ middleman s3_sync --prefix=my/new/prefix

## Pushing to a folder within a bucket

You can push to a folder within an S3 bucket by adding using the prefix
Expand Down
4 changes: 4 additions & 0 deletions lib/middleman-s3_sync/commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ def self.exit_on_failure?
method_option :bucket, type: :string,
desc: "Specify which bucket to use, overrides the configured bucket.",
aliases: '-b'
method_option :prefix, type: :string,
desc: "Specify which prefix to use, overrides the configured prefix.",
aliases: '-p'
method_option :verbose, type: :boolean,
desc: "Adds more verbosity...",
aliases: '-v'
Expand All @@ -37,6 +40,7 @@ def s3_sync
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]
s3_sync_options.prefix = options[:prefix] if options[:prefix]

::Middleman::S3Sync.sync(s3_sync_options)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/middleman/s3_sync/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Middleman
module S3Sync
VERSION = "3.0.45"
VERSION = "3.0.46"
end
end

0 comments on commit cb7b6a1

Please sign in to comment.