fix: update fastlist directory

This commit is contained in:
Zamitto 2024-04-30 16:04:42 -03:00
parent 06d334d2d7
commit f14ddba807
4 changed files with 5 additions and 7 deletions

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
.vscode .vscode
node_modules node_modules
hydra-download-manager hydra-download-manager
fastlist.exe
__pycache__ __pycache__
dist dist
out out

View File

@ -5,6 +5,7 @@ directories:
extraResources: extraResources:
- hydra-download-manager - hydra-download-manager
- hydra.db - hydra.db
- fastlist.exe
files: files:
- "!**/.vscode/*" - "!**/.vscode/*"
- "!src/*" - "!src/*"

View File

@ -1,12 +1,8 @@
const fs = require("fs"); const fs = require("fs");
if (process.platform === "win32") { if (process.platform === "win32") {
if (!fs.existsSync("resources/dist")) {
fs.mkdirSync("resources/dist");
}
fs.copyFileSync( fs.copyFileSync(
"node_modules/ps-list/vendor/fastlist-0.3.0-x64.exe", "node_modules/ps-list/vendor/fastlist-0.3.0-x64.exe",
"resources/dist/fastlist.exe" "fastlist.exe"
); );
} }

View File

@ -10,8 +10,8 @@ const execFile = promisify(childProcess.execFile);
export const getProcesses = async () => { export const getProcesses = async () => {
if (process.platform == "win32") { if (process.platform == "win32") {
const binaryPath = app.isPackaged const binaryPath = app.isPackaged
? path.join(process.resourcesPath, "dist", "fastlist.exe") ? path.join(process.resourcesPath, "fastlist.exe")
: path.join(__dirname, "..", "..", "resources", "dist", "fastlist.exe"); : path.join(__dirname, "..", "..", "fastlist.exe");
const { stdout } = await execFile(binaryPath, { const { stdout } = await execFile(binaryPath, {
maxBuffer: TEN_MEGABYTES, maxBuffer: TEN_MEGABYTES,