-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fixed it so Ka0s repacks work on linux #153
Conversation
found a bug with the yaml generating. fixing it then commiting |
There was a problem hiding this 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
…a varible instead.
@@ -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); |
There was a problem hiding this comment.
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.
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. |
There was a problem hiding this 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); |
There was a problem hiding this comment.
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(); | |||
}; | |||
}; |
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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
Closing this since I haven't had any updates in a while. |
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?