fix fetch
This commit is contained in:
+2
-3
@@ -16,9 +16,8 @@ type TagItem = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export async function fetchVersions() {
|
export async function fetchVersions() {
|
||||||
const tags: [TagItem] = await (await fetch(
|
const file = await downloadTool("https://api.github.com/repos/xmake-io/xmake/git/refs/tags");
|
||||||
"https://api.github.com/repos/xmake-io/xmake/git/refs/tags"
|
const tags: [TagItem] = JSON.parse(await fs.readFile(file, { encoding: "utf-8" }));
|
||||||
)).json();
|
|
||||||
return tags.map(({ ref, object: {sha} }) => [ref.slice(11), sha]).reduce(
|
return tags.map(({ ref, object: {sha} }) => [ref.slice(11), sha]).reduce(
|
||||||
(o, [k, v]) => {
|
(o, [k, v]) => {
|
||||||
o[k] = v;
|
o[k] = v;
|
||||||
|
|||||||
Reference in New Issue
Block a user