mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
refactor: use path join in yml file
This commit is contained in:
parent
729f3995fa
commit
54e29c12d4
1 changed files with 5 additions and 4 deletions
|
@ -1,13 +1,14 @@
|
||||||
import { Document as YMLDocument } from 'yaml';
|
import { Document as YMLDocument } from 'yaml';
|
||||||
import { Game } from '@main/entity';
|
import { Game } from '@main/entity';
|
||||||
|
import path from "node:path";
|
||||||
|
|
||||||
export function generateYML(game: Game) {
|
export function generateYML(game: Game) {
|
||||||
const slugfiedName = game.title.replace(/\s/g, '-').toLocaleLowerCase();
|
const slugfiedGameTitle = game.title.replace(/\s/g, '-').toLocaleLowerCase();
|
||||||
|
|
||||||
const doc = new YMLDocument({
|
const doc = new YMLDocument({
|
||||||
name: game.title,
|
name: game.title,
|
||||||
game_slug: slugfiedName,
|
game_slug: slugfiedGameTitle,
|
||||||
slug: `${slugfiedName}-installer`,
|
slug: `${slugfiedGameTitle}-installer`,
|
||||||
version: 'Installer',
|
version: 'Installer',
|
||||||
runner: 'wine',
|
runner: 'wine',
|
||||||
script: {
|
script: {
|
||||||
|
@ -19,7 +20,7 @@ export function generateYML(game: Game) {
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
task: {
|
task: {
|
||||||
executable: `${game.downloadPath}/${game.folderName}/setup.exe`,
|
executable: path.join(game.downloadPath, game.folderName, 'setup.exe'),
|
||||||
name: "wineexec",
|
name: "wineexec",
|
||||||
prefix: "$GAMEDIR/prefix"
|
prefix: "$GAMEDIR/prefix"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue