mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
reorganize post install
This commit is contained in:
parent
e83e7dc680
commit
e93f02ca76
1 changed files with 19 additions and 18 deletions
|
@ -5,12 +5,7 @@ const { spawnSync } = require("node:child_process");
|
||||||
|
|
||||||
const exec = util.promisify(require("node:child_process").exec);
|
const exec = util.promisify(require("node:child_process").exec);
|
||||||
|
|
||||||
const downloadAria2WindowsAndLinux = async () => {
|
const setupAria2OnWindowsAndLinux = async () => {
|
||||||
if (fs.existsSync("aria2")) {
|
|
||||||
console.log("Aria2 already exists, skipping download...");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const file =
|
const file =
|
||||||
process.platform === "win32"
|
process.platform === "win32"
|
||||||
? "aria2-1.37.0-win-64bit-build1.zip"
|
? "aria2-1.37.0-win-64bit-build1.zip"
|
||||||
|
@ -48,12 +43,7 @@ const downloadAria2WindowsAndLinux = async () => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const copyAria2Macos = async () => {
|
const setupAria2OnMacos = async () => {
|
||||||
if (fs.existsSync("aria2")) {
|
|
||||||
console.log("Aria2 already exists, skipping...");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log("Checking if aria2 is installed...");
|
console.log("Checking if aria2 is installed...");
|
||||||
|
|
||||||
const isAria2Installed = spawnSync("which", ["aria2c"]).status;
|
const isAria2Installed = spawnSync("which", ["aria2c"]).status;
|
||||||
|
@ -69,15 +59,26 @@ const copyAria2Macos = async () => {
|
||||||
await exec(`cp $(which aria2c) aria2/aria2c`);
|
await exec(`cp $(which aria2c) aria2/aria2c`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const setupAria2 = () => {
|
||||||
|
if (fs.existsSync("aria2")) {
|
||||||
|
console.log("Aria2 already exists, skipping...");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process.platform == "darwin") {
|
||||||
|
setupAria2OnMacos();
|
||||||
|
} else {
|
||||||
|
setupAria2OnWindowsAndLinux();
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("Aria2 setup finished");
|
||||||
|
};
|
||||||
|
|
||||||
|
setupAria2();
|
||||||
|
|
||||||
if (process.platform === "win32") {
|
if (process.platform === "win32") {
|
||||||
fs.copyFileSync(
|
fs.copyFileSync(
|
||||||
"node_modules/ps-list/vendor/fastlist-0.3.0-x64.exe",
|
"node_modules/ps-list/vendor/fastlist-0.3.0-x64.exe",
|
||||||
"fastlist.exe"
|
"fastlist.exe"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.platform == "darwin") {
|
|
||||||
copyAria2Macos();
|
|
||||||
} else {
|
|
||||||
downloadAria2WindowsAndLinux();
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue