mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 12:09:51 +02:00
feat: linux dist
This commit is contained in:
1 parent
38989689f5
commit
f78c1ea75f
1 file changed
+6
-2
@@ -14,10 +14,14 @@ await fetch(
|
|||||||
.then(
|
.then(
|
||||||
(response) =>
|
(response) =>
|
||||||
response.json() as Promise<{
|
response.json() as Promise<{
|
||||||
assets: { browser_download_url: string }[];
|
assets: { browser_download_url: string; name: string }[];
|
||||||
}>,
|
}>,
|
||||||
)
|
)
|
||||||
.then(({ assets }) => fetch(assets[0].browser_download_url))
|
.then(({ assets }) => {
|
||||||
|
const asset = assets.find(({ name }) => name.includes('linux-x64'));
|
||||||
|
if (!asset) throw new Error('No asset found');
|
||||||
|
return fetch(asset.browser_download_url);
|
||||||
|
})
|
||||||
.then((response) => response.arrayBuffer())
|
.then((response) => response.arrayBuffer())
|
||||||
.then((arrayBuffer) =>
|
.then((arrayBuffer) =>
|
||||||
writeFile('temp/depotDownloader.zip', Buffer.from(arrayBuffer)),
|
writeFile('temp/depotDownloader.zip', Buffer.from(arrayBuffer)),
|
||||||
|
|||||||
Reference in new issue
Block a user