From 0c3e342a4510823dbd408e8ea37c9ca3890ed7aa Mon Sep 17 00:00:00 2001 From: Pierce Thompson Date: Wed, 28 Jun 2023 15:39:46 -0400 Subject: [PATCH] Use Electron to get home directory --- src/main/services/steam.service.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/services/steam.service.ts b/src/main/services/steam.service.ts index 18499d02..08eb0053 100644 --- a/src/main/services/steam.service.ts +++ b/src/main/services/steam.service.ts @@ -6,8 +6,7 @@ import { readFile } from "fs/promises"; import { spawn } from "child_process"; import { pathExist } from "../helpers/fs.helpers"; import log from "electron-log"; -import psList from 'ps-list'; -import os from 'os'; +import { app } from "electron"; export class SteamService{ @@ -48,7 +47,7 @@ export class SteamService{ switch (process.platform) { case "linux": - this.steamPath = path.join(os.homedir(), '.steam', "steam"); + this.steamPath = path.join(app.getPath('home'), '.steam', "steam"); return this.steamPath; case "win32": const [win32Res, win64Res] = await Promise.all([