Merge pull request #14 from Narsul/master

added `delete_removed` config param to deploy
This commit is contained in:
Nicholas Terwoord
2017-11-14 20:58:57 -05:00
committed by GitHub
2 changed files with 8 additions and 2 deletions

View File

@@ -33,6 +33,9 @@ module.exports = function(args) {
var log = this.log;
var customHeaders = args.headers || {};
var deleteRemoved = args.hasOwnProperty('delete_removed')
? Boolean(args.delete_removed)
: true;
if (!args.bucket || !config.s3Options.accessKeyId || !config.s3Options.secretAccessKey) {
var help = '';
@@ -47,7 +50,8 @@ module.exports = function(args) {
help += ' [concurrency]: <concurrency>\n';
help += ' [region]: <region> # See https://github.com/LearnBoost/knox#region\n',
help += ' [headers]: <JSON headers> # Optional, see README.md file\n';
help += ' [prefix]: <prefix> # Optional, prefix ending in /\n\n';
help += ' [prefix]: <prefix> # Optional, prefix ending in /\n';
help += ' [delete_removed]: <delete> # Optional, if true will delete removed files from S3 /\n\n';
help += 'For more help, you can check the docs: ' + chalk.underline('https://github.com/nt3rp/hexo-deployer-s3');
console.log(help);
@@ -56,7 +60,7 @@ module.exports = function(args) {
var params = {
localDir: publicDir,
deleteRemoved: true,
deleteRemoved: deleteRemoved,
s3Params: xtend({
Bucket: args.bucket,
Prefix: args.prefix