mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 03:29:51 +02:00
feat: update all
This commit is contained in:
1 parent
3efe807e35
commit
a0bccc7973
21 files changed
+160
-306
No files matched your search
@@ -1,39 +1,39 @@
|
||||
import decompress from 'decompress';
|
||||
import { existsSync } from 'fs';
|
||||
import { mkdir, readdir, writeFile } from 'fs/promises';
|
||||
import decompress from "decompress";
|
||||
import { existsSync } from "fs";
|
||||
import { mkdir, readdir, writeFile } from "fs/promises";
|
||||
|
||||
if (!existsSync('../../temp')) {
|
||||
console.log('Creating temp directory...');
|
||||
await mkdir('../../temp');
|
||||
if (!existsSync("../../temp")) {
|
||||
console.log("Creating temp directory...");
|
||||
await mkdir("../../temp");
|
||||
}
|
||||
|
||||
console.log('Downloading depot downloader...');
|
||||
console.log("Downloading depot downloader...");
|
||||
await fetch(
|
||||
'https://api.github.com/repos/SteamRE/DepotDownloader/releases/latest',
|
||||
"https://api.github.com/repos/SteamRE/DepotDownloader/releases/latest"
|
||||
)
|
||||
.then(
|
||||
(response) =>
|
||||
response.json() as Promise<{
|
||||
assets: { browser_download_url: string; name: string }[];
|
||||
}>,
|
||||
}>
|
||||
)
|
||||
.then(({ assets }) => {
|
||||
const asset = assets.find(({ name }) => name.includes('linux-x64'));
|
||||
if (!asset) throw new Error('No asset found');
|
||||
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((arrayBuffer) =>
|
||||
writeFile('../../temp/depotDownloader.zip', new Uint8Array(arrayBuffer)),
|
||||
writeFile("../../temp/depotDownloader.zip", new Uint8Array(arrayBuffer))
|
||||
);
|
||||
|
||||
console.log('Unzipping...');
|
||||
console.log("Unzipping...");
|
||||
await decompress(
|
||||
'../../temp/depotDownloader.zip',
|
||||
'../../temp/depotDownloader',
|
||||
"../../temp/depotDownloader.zip",
|
||||
"../../temp/depotDownloader"
|
||||
);
|
||||
|
||||
console.log(
|
||||
'Download complete; files:',
|
||||
await readdir('../../temp/depotDownloader'),
|
||||
"Download complete; files:",
|
||||
await readdir("../../temp/depotDownloader")
|
||||
);
|
||||
Reference in new issue
Block a user