From f14ddba8075f964fe318c11ed35f5f28f0d15445 Mon Sep 17 00:00:00 2001 From: Zamitto Date: Tue, 30 Apr 2024 16:04:42 -0300 Subject: [PATCH] fix: update fastlist directory --- .gitignore | 1 + electron-builder.yml | 1 + postinstall.cjs | 6 +----- src/main/helpers/ps.ts | 4 ++-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 0767dd62..675a83ee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .vscode node_modules hydra-download-manager +fastlist.exe __pycache__ dist out diff --git a/electron-builder.yml b/electron-builder.yml index 9101b028..9acb2eac 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -5,6 +5,7 @@ directories: extraResources: - hydra-download-manager - hydra.db + - fastlist.exe files: - "!**/.vscode/*" - "!src/*" diff --git a/postinstall.cjs b/postinstall.cjs index 0b47b380..8ca8f101 100644 --- a/postinstall.cjs +++ b/postinstall.cjs @@ -1,12 +1,8 @@ const fs = require("fs"); if (process.platform === "win32") { - if (!fs.existsSync("resources/dist")) { - fs.mkdirSync("resources/dist"); - } - fs.copyFileSync( "node_modules/ps-list/vendor/fastlist-0.3.0-x64.exe", - "resources/dist/fastlist.exe" + "fastlist.exe" ); } diff --git a/src/main/helpers/ps.ts b/src/main/helpers/ps.ts index dbc11f09..380b5116 100644 --- a/src/main/helpers/ps.ts +++ b/src/main/helpers/ps.ts @@ -10,8 +10,8 @@ const execFile = promisify(childProcess.execFile); export const getProcesses = async () => { if (process.platform == "win32") { const binaryPath = app.isPackaged - ? path.join(process.resourcesPath, "dist", "fastlist.exe") - : path.join(__dirname, "..", "..", "resources", "dist", "fastlist.exe"); + ? path.join(process.resourcesPath, "fastlist.exe") + : path.join(__dirname, "..", "..", "fastlist.exe"); const { stdout } = await execFile(binaryPath, { maxBuffer: TEN_MEGABYTES,