From 74e7a6e5c12fe71b4ee94e9a6170ae212f295f56 Mon Sep 17 00:00:00 2001 From: Nicholas Terwoord Date: Mon, 1 Sep 2014 19:47:54 -0400 Subject: [PATCH] Pass along region information This PR allows someone to define a `region` key in `_config.yml` so that upload works correctly via `s3-sync`. Why? [`s3-sync`](https://github.com/hughsk/s3-sync) uses [`knox`](https://github.com/LearnBoost/knox) to handle S3 commands. Unless your are uploading to `us-standard`, the upload will fail because the S3 url won't be correct. --- README.md | 3 ++- index.js | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 445e967..faf4974 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ deploy: aws_key: aws_secret: concurrency: //Optional + region: //Optional, see https://github.com/LearnBoost/knox#region ``` ### Disable @@ -57,4 +58,4 @@ Execute the following command. Don't forget to disable the plugin before uninsta npm uninstall hexo-deployer-s3 ``` -[Hexo]: http://zespia.tw/hexo \ No newline at end of file +[Hexo]: http://zespia.tw/hexo diff --git a/index.js b/index.js index 2752f01..cf4e801 100644 --- a/index.js +++ b/index.js @@ -21,6 +21,7 @@ hexo.extend.deployer.register('s3', function (args, callback) { ' aws_key: ', ' aws_secret: ', ' [concurrency]: ', + ' [region]: # See https://github.com/LearnBoost/knox#region', '', 'For more help, you can check the docs: ' + 'https://github.com/joshstrange/hexo-deployer-s3' ]; @@ -47,6 +48,7 @@ hexo.extend.deployer.register('s3', function (args, callback) { , secret: config.aws_secret , bucket: config.bucket , concurrency: config.concurrency + , region: config.region }).on('data', function(file) { console.log(file.fullPath + ' -> ' + file.url) }).on('end', function() {