Skip to content

Commit

Permalink
bugfix for logPrefix with save operation
Browse files Browse the repository at this point in the history
  • Loading branch information
frytg committed Oct 28, 2020
1 parent 3b64d01 commit da6e023
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@swrlab/node-storage-wrapper",
"version": "0.2.0",
"version": "0.2.1",
"description": "Wrapping AWS S3, GCP GCS, file storage",
"main": "./src/index.js",
"engines": {
Expand Down
6 changes: 3 additions & 3 deletions src/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module.exports = async function (uri, buffer, logPrefix) {
path = structure.join('/');

// log progress
this.sdk.log(this, 'log', [logPrefix ? logPrefix : undefined, 'storage.save.s3 >', uri]);
this.sdk.log(this, 'log', logPrefix.concat(['storage.save.s3 >', uri]));

// upload to aws
await this.sdk.s3
Expand All @@ -61,7 +61,7 @@ module.exports = async function (uri, buffer, logPrefix) {
await saveLocalFile(this, tempFilePath, buffer);

// log progress
this.sdk.log(this, 'log', [logPrefix ? logPrefix : undefined, 'storage.save.gs >', uri]);
this.sdk.log(this, 'log', logPrefix.concat(['storage.save.gs >', uri]));

// upload file to gcs
await this.sdk.gs.bucket(bucket).upload(tempFilePath, {
Expand All @@ -79,7 +79,7 @@ module.exports = async function (uri, buffer, logPrefix) {
// local file

// log progress
this.sdk.log(this, 'log', [logPrefix ? logPrefix : undefined, 'storage.save.local >', uri]);
this.sdk.log(this, 'log', logPrefix.concat(['storage.save.local >', uri]));

// save file
let file = await saveLocalFile(this, uri, buffer);
Expand Down

0 comments on commit da6e023

Please sign in to comment.