use node fs

This commit is contained in:
Zamitto 2024-05-29 19:55:37 -03:00
parent 077f78c252
commit 4d61b8586d

View File

@ -37,9 +37,9 @@ const downloadAria2 = async () => {
} else {
await exec(`tar --zstd -xvf ${file} usr/bin/aria2c`);
console.log("Extracted. Copying binary file...");
await exec(`mkdir aria2`);
await exec(`cp ./usr/bin/aria2c ./aria2/aria2c`);
await exec(`rm -r ./usr`);
fs.mkdirSync("aria2");
fs.copyFileSync("usr/bin/aria2c", "aria2/aria2c");
fs.rmSync("usr", { recursive: true });
}
console.log(`Extracted ${file}, removing compressed downloaded file...`);