mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-29 22:01:03 +00:00
fix: fixing ludusavi download
This commit is contained in:
10
index.ts
10
index.ts
@@ -1,10 +0,0 @@
|
|||||||
import vdf from "vdf-parser";
|
|
||||||
import fs from "node:fs";
|
|
||||||
|
|
||||||
const vdfData = fs.readFileSync(
|
|
||||||
"/home/chubby/.local/share/Steam/userdata/1126196664/config/localconfig.vdf",
|
|
||||||
"utf-8"
|
|
||||||
);
|
|
||||||
const data = vdf.parse(vdfData);
|
|
||||||
|
|
||||||
console.log(data);
|
|
||||||
@@ -15,8 +15,18 @@ const fileName = {
|
|||||||
darwin: `ludusavi-v${ludusaviVersion}-mac.tar.gz`,
|
darwin: `ludusavi-v${ludusaviVersion}-mac.tar.gz`,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const ludusaviBinaryName = {
|
||||||
|
win32: "ludusavi.exe",
|
||||||
|
linux: "ludusavi",
|
||||||
|
darwin: "ludusavi",
|
||||||
|
};
|
||||||
|
|
||||||
const downloadLudusavi = async () => {
|
const downloadLudusavi = async () => {
|
||||||
if (fs.existsSync("ludusavi")) {
|
if (
|
||||||
|
fs.existsSync(
|
||||||
|
path.join(process.cwd(), "ludusavi", ludusaviBinaryName[process.platform])
|
||||||
|
)
|
||||||
|
) {
|
||||||
console.log("Ludusavi already exists, skipping download...");
|
console.log("Ludusavi already exists, skipping download...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,9 +106,6 @@ export class Ludusavi {
|
|||||||
|
|
||||||
config.customGames = filteredGames;
|
config.customGames = filteredGames;
|
||||||
|
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(this.configPath, YAML.stringify(config));
|
||||||
path.join(this.ludusaviPath, "config.yaml"),
|
|
||||||
YAML.stringify(config)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,18 +4,18 @@ import path from "node:path";
|
|||||||
export class Wine {
|
export class Wine {
|
||||||
public static validatePrefix(winePrefixPath: string) {
|
public static validatePrefix(winePrefixPath: string) {
|
||||||
const requiredFiles = [
|
const requiredFiles = [
|
||||||
"system.reg",
|
{ name: "system.reg", type: "file" },
|
||||||
"user.reg",
|
{ name: "user.reg", type: "file" },
|
||||||
"userdef.reg",
|
{ name: "userdef.reg", type: "file" },
|
||||||
"dosdevices",
|
{ name: "dosdevices", type: "dir" },
|
||||||
"drive_c",
|
{ name: "drive_c", type: "dir" },
|
||||||
];
|
];
|
||||||
|
|
||||||
for (const file of requiredFiles) {
|
for (const file of requiredFiles) {
|
||||||
const filePath = path.join(winePrefixPath, file);
|
const filePath = path.join(winePrefixPath, file.name);
|
||||||
if (!fs.existsSync(filePath)) {
|
|
||||||
return false;
|
if (file.type === "file") return !fs.existsSync(filePath);
|
||||||
}
|
if (file.type === "dir") return !fs.lstatSync(filePath).isDirectory();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user