const AWS = require('aws-sdk')
const fs = require('fs')
const Promise = require('bluebird')
const mime = require('mime')

module.exports = function () {
  var s3 = new AWS.S3()
  var put = Promise.promisify(s3.putObject, s3)

  return Promise.map(fs.readdirSync('dist'), function (filename) {
    return put({
      Key: 'misc/lively/' + filename,
      Body: fs.readFileSync('dist/' + filename),
      ContentType: mime.lookup(filename),
      Bucket: process.env.AWS_S3_BUCKET,
      ACL: 'public-read'
    })
  })
}

@@ -113,16 +113,47 @@
 ('mime')
+%0Aimport config from '../config'
 %0A%0Amodule
@@ -244,19 +244,30 @@
 tObject,
+ %7Bcontext:
  s3
+%7D
 )%0A%0A  ret
@@ -492,33 +492,24 @@
 et: 
-process.env.AWS_S3_BUCKET
+config.s3.bucket
 ,%0A  

fix uploading task