Comparing version 0.1.1 to 0.2.0
#!/usr/bin/env node | ||
/*global require, process*/ | ||
require('./')(process.argv[2], process.argv[3]); | ||
require('./').apply(null, process.argv.splice(2)); |
14
index.js
/*global require, module, process, console*/ | ||
/*eslint no-console:0*/ | ||
module.exports = function(deployDir, amazonBucket) { | ||
module.exports = function(deployDir, amazonBucket, amazonKey, amazonSecret) { | ||
if (!deployDir) { return console.log('Missing source directory'); } | ||
if (!amazonBucket) { return console.log('Missing Amazon Bucket name'); } | ||
amazonKey = amazonKey || process.env.AMAZON_KEY; | ||
amazonSecret = amazonSecret || process.env.AMAZON_SECRET; | ||
if (!deployDir) { return console.error('Missing source directory'); } | ||
if (!amazonBucket) { return console.error('Missing Amazon Bucket name'); } | ||
if (!amazonKey) { return console.error('Missing Amazon Key'); } | ||
if (!amazonSecret) { return console.error('Missing Amazon Secret'); } | ||
@@ -16,4 +20,4 @@ var fs = require('fs'), | ||
s3Options: { | ||
accessKeyId: process.env.AMAZON_KEY, | ||
secretAccessKey: process.env.AMAZON_SECRET, | ||
accessKeyId: amazonKey, | ||
secretAccessKey: amazonSecret, | ||
region: 'eu-west-1' | ||
@@ -20,0 +24,0 @@ } |
{ | ||
"name": "s3dist", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"description": "A command for syncing a local directory to a Amazon S3 Bucket", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
6701
65