Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/updates.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,12 @@ class Updates {
const body = await rres.text();
const matches = body.match(/[^ ]*\.nupkg/gim);
assert(matches);
const nuPKG = rurl.replace("RELEASES", matches[0]);
latest[key].RELEASES = body.replace(matches[0], nuPKG);
let RELEASES = body;
for (const match of matches) {
const nuPKG = rurl.replace("RELEASES", match);
RELEASES = RELEASES.replace(match, nuPKG);
}
latest[key].RELEASES = RELEASES;
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions test/update.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ nock("https://api.github.com")
nock("https://github.com")
.get("/owner/repo/releases/download/1.0.0/RELEASES")
.times(3)
.reply(200, "HASH name.nupkg NUMBER")
.reply(200, "HASH name.nupkg NUMBER\nHASH2 name2.nupkg NUMBER2")
.get("/owner/repo-with-v/releases/download/v1.0.0/RELEASES")
.reply(404)
.get("/owner/repo-darwin/releases/download/v1.0.0/RELEASES")
Expand Down Expand Up @@ -361,7 +361,7 @@ test("Updates", async (t) => {
const body = await res.text();
t.match(
body,
/^[^ ]+ https:\/\/github.com\/owner\/repo\/releases\/download\/[^/]+\/name.nupkg [^ ]+$/
/^[^ ]+ https:\/\/github.com\/owner\/repo\/releases\/download\/[^/]+\/name.nupkg [^ ]+\n[^ ]+ https:\/\/github.com\/owner\/repo\/releases\/download\/[^/]+\/name2.nupkg [^ ]+$/
);
}

Expand All @@ -373,7 +373,7 @@ test("Updates", async (t) => {
const body = await res.text();
t.match(
body,
/^[^ ]+ https:\/\/github.com\/owner\/repo\/releases\/download\/[^/]+\/name.nupkg [^ ]+$/
/^[^ ]+ https:\/\/github.com\/owner\/repo\/releases\/download\/[^/]+\/name.nupkg [^ ]+\n[^ ]+ https:\/\/github.com\/owner\/repo\/releases\/download\/[^/]+\/name2.nupkg [^ ]+$/
);
}
});
Expand All @@ -387,7 +387,7 @@ test("Updates", async (t) => {
const body = await res.text();
t.match(
body,
/^[^ ]+ https:\/\/github.com\/owner\/repo\/releases\/download\/[^/]+\/name.nupkg [^ ]+$/
/^[^ ]+ https:\/\/github.com\/owner\/repo\/releases\/download\/[^/]+\/name.nupkg [^ ]+\n[^ ]+ https:\/\/github.com\/owner\/repo\/releases\/download\/[^/]+\/name2.nupkg [^ ]+$/
);
}
});
Expand Down