From 7682e11e55c9e8256b234bf5a0fb2998125450b3 Mon Sep 17 00:00:00 2001 From: twelve dogs Date: Tue, 28 Nov 2023 12:28:39 +1100 Subject: [PATCH 1/2] added check for legendary within heroic config folder --- src/installfinders/linux/legendary.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/installfinders/linux/legendary.ts b/src/installfinders/linux/legendary.ts index da81bd2..c996aee 100644 --- a/src/installfinders/linux/legendary.ts +++ b/src/installfinders/linux/legendary.ts @@ -36,12 +36,21 @@ interface LegendaryConfig { } const LEGENDARY_DATA_PATH = `${process.env.HOME}/.config/legendary/installed.json`; +const HEROIC_LEGENDARY_DATA_PATH = `${process.env.HOME}/.config/heroic/legendaryConfig/legendary/installed.json`; export function getInstalls(): InstallFindResult { const installs: Array = []; const invalidInstalls: Array = []; - if (fs.existsSync(LEGENDARY_DATA_PATH)) { - const legendaryInstalls = JSON.parse(fs.readFileSync(LEGENDARY_DATA_PATH, 'utf8')) as LegendaryData; + let DATA_PATH:string = ''; + + if (fs.existsSync(HEROIC_LEGENDARY_DATA_PATH)) { + DATA_PATH = HEROIC_LEGENDARY_DATA_PATH; + } else if (fs.existsSync(LEGENDARY_DATA_PATH)) { + DATA_PATH = LEGENDARY_DATA_PATH; + } + + if (DATA_PATH != '') { + const legendaryInstalls = JSON.parse(fs.readFileSync(DATA_PATH, 'utf8')) as LegendaryData; Object.values(legendaryInstalls).forEach((legendaryGame) => { if (legendaryGame.app_name.includes('Crab')) { let canLaunch = false; From c4046e58772dcfa2cf214c704032253f10f4c9d0 Mon Sep 17 00:00:00 2001 From: twelve dogs Date: Tue, 28 Nov 2023 12:40:26 +1100 Subject: [PATCH 2/2] fix linting --- src/installfinders/linux/legendary.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/installfinders/linux/legendary.ts b/src/installfinders/linux/legendary.ts index c996aee..6096d2a 100644 --- a/src/installfinders/linux/legendary.ts +++ b/src/installfinders/linux/legendary.ts @@ -41,7 +41,7 @@ const HEROIC_LEGENDARY_DATA_PATH = `${process.env.HOME}/.config/heroic/legendary export function getInstalls(): InstallFindResult { const installs: Array = []; const invalidInstalls: Array = []; - let DATA_PATH:string = ''; + let DATA_PATH = ''; if (fs.existsSync(HEROIC_LEGENDARY_DATA_PATH)) { DATA_PATH = HEROIC_LEGENDARY_DATA_PATH; @@ -49,7 +49,7 @@ export function getInstalls(): InstallFindResult { DATA_PATH = LEGENDARY_DATA_PATH; } - if (DATA_PATH != '') { + if (DATA_PATH !== '') { const legendaryInstalls = JSON.parse(fs.readFileSync(DATA_PATH, 'utf8')) as LegendaryData; Object.values(legendaryInstalls).forEach((legendaryGame) => { if (legendaryGame.app_name.includes('Crab')) {