Skip to content

Commit

Permalink
Emit writefile event when finishing.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenglongMa committed Dec 8, 2020
1 parent d146320 commit 454067a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ module.exports = function SkipperGCS(globalOpts) {
.on('error', (err) => receiver__.emit("error", err))
.on('finish', function () {
incomingFileStream.extra = file.metadata;
// Indicate that a file was persisted.
receiver__.emit('writefile', incomingFileStream);
if (options.public) {
file.makePublic().then(() => {
incomingFileStream.extra.Location = "https://storage.googleapis.com/" + options.bucket + "/" + incomingFd;
Expand Down

0 comments on commit 454067a

Please sign in to comment.