fix: fixing return logic for wine prefix

This commit is contained in:
Chubby Granny Chaser
2025-05-12 02:25:32 +00:00
parent e901df9ac7
commit 427b77c597

View File

@@ -14,8 +14,15 @@ export class Wine {
for (const file of requiredFiles) {
const filePath = path.join(winePrefixPath, file.name);
if (file.type === "file") return !fs.existsSync(filePath);
if (file.type === "dir") return !fs.lstatSync(filePath).isDirectory();
if (file.type === "file" && !fs.existsSync(filePath)) {
return false;
}
if (file.type === "dir") {
if (!fs.existsSync(filePath) || !fs.lstatSync(filePath).isDirectory()) {
return false;
}
}
}
return true;