Skip to content

Commit

Permalink
(feature) Adding logging to node script when sending attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
craigatk committed Mar 4, 2020
1 parent e9d2b12 commit 64af51c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion publishers/node-script/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "projektor-publish",
"version": "2.0.1",
"version": "2.0.2",
"homepage": "https://github.com/craigatk/projektor/blob/master/publishers/node-script/README.md",
"repository": {
"type": "git",
Expand Down
28 changes: 19 additions & 9 deletions publishers/node-script/src/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,25 @@ const collectAndSendResults = (
.then(publicId => {
if (attachmentFileGlobs && attachmentFileGlobs.length > 0) {
const attachments = collectAttachments(attachmentFileGlobs);
attachments.forEach(attachment =>
sendAttachment(
serverUrl,
publicId,
publishToken,
attachment.contents,
attachment.name
)
);
const attachmentsCount = attachments.length;

if (attachmentsCount) {
console.log(
`Sending ${attachmentsCount} attachments to Projektor server`
);
attachments.forEach(attachment =>
sendAttachment(
serverUrl,
publicId,
publishToken,
attachment.contents,
attachment.name
)
);
console.log(
`Finished sending attachments ${attachmentsCount} to Projektor`
);
}
}
})
.catch(e => {
Expand Down

0 comments on commit 64af51c

Please sign in to comment.