Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed it so Ka0s repacks work on linux #153

Closed

Conversation

gylli251
Copy link

@gylli251 gylli251 commented May 1, 2024

Fixed it so Ka0s repacks work on linux, its using Setup.exe instead of setup.exe.

Side-note:

Should i implement it so if nether setup.exe or Setup.exe is found it prompts the user to select the installer executable?

@gylli251
Copy link
Author

gylli251 commented May 1, 2024

found a bug with the yaml generating. fixing it then commiting

Copy link
Contributor

@Magrid0 Magrid0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks for your contribution

@@ -27,8 +27,11 @@ const openGameInstaller = async (
return true;
}

const setupPath = path.join(gamePath, "setup.exe");
if (!fs.existsSync(setupPath)) {
const files = fs.readdirSync(gamePath);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it makes sense to turn this into a helper function at this point. Any hardcoded names would work fine in windows but may break in linux if name changes capitalization.

@gylli251
Copy link
Author

gylli251 commented May 1, 2024

Turns out Kaos repacks installer does not work at all on Linux, i reached out to them to try to get a resolution to get it working with hydra.

@zamitto zamitto added the bug Something isn't working label May 2, 2024
Copy link
Collaborator

@hydralauncher hydralauncher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few tweaks here and there, looks good overall


export const generateYML = (game: Game) => {
const slugifiedGameTitle = game.title.replace(/\s/g, "-").toLocaleLowerCase();
const gamePath = path.join(game.downloadPath, game.folderName);

const files = fs.readdirSync(gamePath);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't use synchronous operations when using I/O since this might potentially lock the main thread

@@ -41,4 +43,4 @@ export const generateYML = (game: Game) => {
});

return doc.toString();
};
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No newline

const setupFileName = files.find(file => /^setup\.exe$/i.test(file));
const setupPath = setupFileName ? path.join(gamePath, setupFileName) : null;

if (!setupPath || !fs.existsSync(setupPath)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use synchronous I/O operations

@thegrannychaseroperation
Copy link
Collaborator

Closing this since I haven't had any updates in a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants