Skip to content

Commit e5cf41e

Browse files
authored
Fix #86 replace all matches in RELEASES (#87)
1 parent 6de7532 commit e5cf41e

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

lib/cache.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ module.exports = class Cache {
5858
{ retries: 3 }
5959
)
6060

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

6464
if (matches.length === 0) {
@@ -67,8 +67,11 @@ module.exports = class Cache {
6767
)
6868
}
6969

70-
const nuPKG = url.replace('RELEASES', matches[0])
71-
return content.replace(matches[0], nuPKG)
70+
for (let i = 0; i < matches.length; i += 1) {
71+
const nuPKG = url.replace('RELEASES', matches[i])
72+
content = content.replace(matches[i], nuPKG)
73+
}
74+
return content
7275
}
7376

7477
async refreshCache() {

0 commit comments

Comments
 (0)