Skip to content

Commit

Permalink
Filter only unique uploads (#221) (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
robinwassen authored and ralphtheninja committed Aug 7, 2018
1 parent 1be336b commit 95ef129
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,14 @@ if (opts['upload-all']) {
}

function uploadFiles (files) {
buildLog('Uploading ' + files.length + ' prebuilds(s) to Github releases')
upload(extend(opts, {files: files}), function (err, result) {
// NOTE(robinwassen): Only include unique files
// See: https://github.com/prebuild/prebuild/issues/221
var uniqueFiles = files.filter(function (file, index) {
return files.indexOf(file) === index
})

buildLog('Uploading ' + uniqueFiles.length + ' prebuilds(s) to Github releases')
upload(extend(opts, {files: uniqueFiles}), function (err, result) {
if (err) return onbuilderror(err)
buildLog('Found ' + result.old.length + ' prebuild(s) on Github')
if (result.old.length) {
Expand Down

0 comments on commit 95ef129

Please sign in to comment.