Skip to content

Commit

Permalink
Fix #86 replace all matches in RELEASES (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanvogel committed Feb 22, 2020
1 parent 6de7532 commit e5cf41e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module.exports = class Cache {
{ retries: 3 }
)

const content = await convertStream(body)
let content = await convertStream(body)
const matches = content.match(/[^ ]*\.nupkg/gim)

if (matches.length === 0) {
Expand All @@ -67,8 +67,11 @@ module.exports = class Cache {
)
}

const nuPKG = url.replace('RELEASES', matches[0])
return content.replace(matches[0], nuPKG)
for (let i = 0; i < matches.length; i += 1) {
const nuPKG = url.replace('RELEASES', matches[i])
content = content.replace(matches[i], nuPKG)
}
return content
}

async refreshCache() {
Expand Down

1 comment on commit e5cf41e

@vercel
Copy link

@vercel vercel bot commented on e5cf41e Feb 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.