diff --git a/package.json b/package.json index eb0e529..7ac50c5 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/save.js b/src/save.js index 2ca3e9b..4eceedc 100644 --- a/src/save.js +++ b/src/save.js @@ -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 @@ -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, { @@ -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);