mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
fix: unzip at root
This commit is contained in:
1 parent
e40fd2d2b4
commit
2f95c57b7f
4 files changed
+350
-5
No files matched your search
@@ -2,9 +2,9 @@ import decompress from 'decompress';
|
||||
import { existsSync } from 'fs';
|
||||
import { mkdir, readdir, writeFile } from 'fs/promises';
|
||||
|
||||
if (!existsSync('temp')) {
|
||||
if (!existsSync('../../temp')) {
|
||||
console.log('Creating temp directory...');
|
||||
await mkdir('temp');
|
||||
await mkdir('../../temp');
|
||||
}
|
||||
|
||||
console.log('Downloading depot downloader...');
|
||||
@@ -24,10 +24,16 @@ await fetch(
|
||||
})
|
||||
.then((response) => response.arrayBuffer())
|
||||
.then((arrayBuffer) =>
|
||||
writeFile('temp/depotDownloader.zip', new Uint8Array(arrayBuffer)),
|
||||
writeFile('../../temp/depotDownloader.zip', new Uint8Array(arrayBuffer)),
|
||||
);
|
||||
|
||||
console.log('Unzipping...');
|
||||
await decompress('temp/depotDownloader.zip', 'temp/depotDownloader');
|
||||
await decompress(
|
||||
'../../temp/depotDownloader.zip',
|
||||
'../../temp/depotDownloader',
|
||||
);
|
||||
|
||||
console.log('Download complete; files:', await readdir('temp/depotDownloader'));
|
||||
console.log(
|
||||
'Download complete; files:',
|
||||
await readdir('../../temp/depotDownloader'),
|
||||
);
|
||||
Reference in new issue
Block a user