1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-11-21 01:34:51 +00:00

AWS Plugin: Lambda should return list of files written to S3

This commit is contained in:
Jermolene
2017-08-29 21:41:50 +01:00
parent 06ea4060cb
commit 08ae7321c1
3 changed files with 17 additions and 3 deletions

View File

@@ -20,7 +20,7 @@ title:
callback: invoked with (err,{body:,type:}
*/
function getFile(region,bucketName,title,callback) {
console.log("Reading file from S3",bucketName,title)
console.log("Reading file from S3",bucketName,title);
var AWS = require("aws-sdk"),
s3bucket = new AWS.S3({
region: region
@@ -46,7 +46,11 @@ console.log("Reading file from S3",bucketName,title)
Put a file to an S3 bucket
*/
function putFile(region,bucketName,title,text,type,callback) {
console.log("Writing file to S3",bucketName,title,type)
// Log the write
if($tw["lambda-result"]) {
$tw["lambda-result"]["files-written"].push({bucket: bucketName,key: title});
}
console.log("Writing file to S3",bucketName,title,type);
var AWS = require("aws-sdk"),
s3bucket = new AWS.S3({
region: region