Fusion des scans (désinstallés, doublons, ajouts manuels), rescan, ajout manuel et explorateur de fichiers pour la manette
Some checks are pending
CI / windows (push) Waiting to run
Some checks are pending
CI / windows (push) Waiting to run
This commit is contained in:
parent
bcc96d5fe5
commit
f68ed4112f
8 changed files with 179 additions and 7 deletions
|
|
@ -60,3 +60,16 @@ export function gamePatch(p: unknown): GamePatch {
|
|||
}
|
||||
return o
|
||||
}
|
||||
|
||||
export function manualInput(p: unknown): { name: string; exe: string; args?: string; workDir?: string } {
|
||||
if (!p || typeof p !== 'object') throw new InvalidInput('jeu invalide')
|
||||
const i = p as Record<string, unknown>
|
||||
const exe = str(i.exe, 260, 'exécutable')
|
||||
if (!/\.(exe|bat|cmd|lnk|url)$/i.test(exe)) throw new InvalidInput('exécutable .exe, .bat, .cmd, .lnk ou .url attendu')
|
||||
return {
|
||||
name: str(i.name ?? '', 200, 'nom').trim() || exe.split(/[\\/]/).pop()!.replace(/\.\w+$/, ''),
|
||||
exe,
|
||||
args: i.args === undefined ? undefined : str(i.args, 1000, 'arguments'),
|
||||
workDir: i.workDir === undefined || i.workDir === '' ? undefined : str(i.workDir, 260, 'dossier de travail')
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue